The return statement of user_access() says:

Boolean TRUE if the current user has the requested permission.

However it is incorrect because user_access may check access for arbitrary account passed in the second parameter.

Comments

Chi created an issue. See original summary.

nicrodgers’s picture

Status: Active » Needs review
StatusFileSize
new607 bytes

I've removed the word 'current' from the return description.

dbjpanda’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Novice, -Documentation

Successfully patched.Patch to be ported.

fabianx’s picture

Component: user.module » documentation
Issue tags: +Pending Drupal 7 commit

Thanks, no longer present in D8. Marking for commit.

  • stefan.r committed 1af0eb4 on 7.x
    Issue #2694731 by nicrodgers: user_access(): incorrect documentation
    
stefan.r’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Pending Drupal 7 commit +DX (Developer Experience)

This seems like a useful clarification, and confirmed this string is not in Drupal 8.

Committed and pushed to 7.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.