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