[development] Deleting Cached Permissions

sysop at scbbs.com sysop at scbbs.com
Fri Aug 24 19:17:25 UTC 2007


Yes, that would be perfect.  The problem is that this functionality is  
currently not in user_access().

I looked at the php docs and see that this is possible, but the only  
way to implement it in user_access() would be to modify the  
user.module -- which I'm trying to avoid.

Quoting Moshe Weitzman <weitzman at tejasa.com>:

> it is reasonable to add a param to user_access() called $reset which
> if true, kills $perm at beginning of function. this is how other
> static caches get rebuilt on demand in drupal.
>
> On 8/23/07, Ron Parker <sysop at scbbs.com> wrote:
>> I wrote this list before on this issue: http://drupal.org/node/166557;
>> but, received no response.  Decided to re-pose the question.
>>
>> The problem is that I'm getting the "access denied" error on file upload
>> even though the file is uploaded. This is because user_access('upload
>> files') is failing for a user who, in fact, has this permission in this
>> particular group.
>>
>> I did the following:
>>
>> 1. Modified user_access() function to NOT cache the $perm permissions.
>> 2. Deleted records from cache_menu.
>>
>> I don't know which (if not both) of the above did the trick, but it
>> resolved the issue.  That means (I think) it's a cache problem.
>>
>> I know I can use cache_clear_all() to delete items from cache_menu.
>> However, I would like know if it's possible to delete/modify the static
>> $perm variable that is set in the user_access() function OUTSIDE of that
>> function?
>>
>> That is:  The user_access() function sets a static variable $perm =
>> array().  Permissions are cached in this variable.  Can I  create a
>> function in my module that can update the $perm variable that is set in
>> the user_access() function of the node.module?
>>
>> Thanks for any assistance.
>>
>> -ron
>>
>> --
>> Ron Parker
>> Software Creations               http://www.scbbs.com
>> Self-Administration Web Site     http://saw.scbbs.com
>> SDSS Subscription Mgmt Service   http://sdss.scbbs.com
>> Central Ave Dance Ensemble       http://www.centralavedance.com
>> R & B Salsa                      http://www.randbsalsa.com
>>
>>
>





More information about the development mailing list