Closed (fixed)
Project:
Drupal core
Component:
user.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Oct 2004 at 16:32 UTC
Updated:
7 Dec 2004 at 22:15 UTC
The user_access function in the user.module should look up the access rights of the currently logged in user, or if an alternative user is given, that user.
In order to ensure that the administrative user always has access rights, this is checked in the beginning of this function. However, this check is made for the current user. This doesn't make sense if the call to this function is asking about another user.
The attached patch makes it check the administrative user, but for the user requested, or if no user is requested the currently logged in one.
| Comment | File | Size | Author |
|---|---|---|---|
| user.module.patch1 | 584 bytes | AlanChandler |
Comments
Comment #1
TDobes commented+1 on this. Straightforward fix for an annoying problem.
Comment #2
Steven commentedFixed in HEAD/4.5.
Comment #3
(not verified) commentedComment #4
TDobes commentedSomething went wrong when this patch was applied to CVS.
Take a look at the change that was applied as opposed to the supplied patch.
The if statement which grants all rights to uid=1 should be based upon account->uid, not $user-> uid. This part of the patch did not land. Therefore, this is still broken, as described in the original problem report. This can be seen by going to the user page for a user without the "edit own blog" permission while logged in as uid=1... the "view recent blog entries" will still appear even though they have not been granted the appropriate permission.
Bug exists in 4.5 and HEAD branch.
Comment #5
dries commentedCorrected in both HEAD and DRUPAL-4-5. Thanks.
Comment #6
(not verified) commented