[development] Permissions Caching

Ron Parker sysop at scbbs.com
Mon Aug 6 22:23:59 UTC 2007


Does Drupal cache permissions?  If so, how can I clear that cache for a 
particular user at a particular time?

I have a module, og_user_roles 
(http://www.drupal.org/project/og_user_roles), which adds group roles to 
the $user object when it is loaded.  So, when function "user_access" 
executes, my module looks to see if the user is in a group context, and 
if so, adds whatever role(s) the user might have within that particular 
context.

A user is having a problem that he explains here: 
http://drupal.org/node/164932.  In short, each time he clicks on a new 
group link, and the group menu is calculated (i.e., what nodes the user 
can create), the user still initially has the same roles from the 
previous group instead of the new group.  Therefore, the group menu will 
display "create" links for which the user may not necessarily have 
permissions in this group.

My guess is that there is some role/permissions caching going on so 
that, for some reason, the $user object isn't loaded when the user 
initally enters the new group, so the permissions remain the same as 
before when the new group menu is calculated.

If I'm correct, then I need to figure out a way to clear this cache so 
that the correct group menu links will always be calculated and displayed.

Thanks in advance for any suggestions.

-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