The static $perm variable in user_access() contains the permissions that users have. When user_access('ClearCache', NULL, TRUE) is executed, the static $perm value is emptied and re-filled with permissions from the current roles in the $user object. Theorectically, when user_access() is next called, assuming the $user object contains the same roles, the $perm variable should contain the same permissions which were cached in the first call. This is what happened in Drupal 5.x and the earlier versions of 6.x. This is NOT happening (at least consistently) in the most recent versions of the user.module.
I've written a bunch of debug code in the user, node and ogur modules and now have more details. I am printing the output of user_access() every time it is called.
When I issue:
user_access('ClearCache', NULL, TRUE)When module_invoke() is immediately executed next:
module_invoke('node_content', 'access', 'create', 'story', $user)user_access('create story content', $user)So far, I've found this behaviour occurs with OGUR when one of the following modules is installed:
I so far am unable to discover what it is about these modules which is causing this problem. This did not occur in 5.x and earlier 6.x versions of Drupal.
Please, please, please help!
-ron