[development] Deleting Cached Permissions

Ron Parker sysop at scbbs.com
Thu Aug 23 06:53:51 UTC 2007

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 

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 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