cancel
Showing results for 
Search instead for 
Did you mean: 

permissionsServiceImpl.setPermission always clears cache

vycitalr
Champ in-the-making
Champ in-the-making
Hello,
I found that the permissionsServiceImpl.setPermission always clears the whole cache (permissionAccessChace). This seems strange to me.

public void setPermission(NodeRef nodeRef, String authority, PermissionReference perm, boolean allow)
    {
        permissionsDaoComponent.setPermission(nodeRef, authority, perm, allow);
        accessCache.clear();
    }
Why for adding one permission for one noderef for one authority the whole cache is thrown away? It's a problem that also the "shared" cache is cleared - not only the trasactional.

I'd rather expect the service manipulates the cache smartly and inserts/changes the permisions entry in the cache - sounds like a common cache scheme. Is there some hidden point I am missing?
For me it's a little problem, cos I am having a performance issues resulting from permissions evaluations. I want to minimize the permissions loading from DB, and so caching would be enough. I even do some sort of cache pre-load. That would work but then a user invokes some common action that internally sets permission and all the cache is out.  Would an update of the cache instead of clearing it be a problem to implement?
Thank you for any comments.
3 REPLIES 3

andy
Champ on-the-rise
Champ on-the-rise
Hi

The implementation is changed in 3.0 and there is no caching required.

Andy

vycitalr
Champ in-the-making
Champ in-the-making
Hi,
I was just curious about how it is reimplemented so I checked the current SVN head and found no obvious changes - setPermission still keeps clearing the cache. Also in the downloaded 3.0.0.-dev nightly build the cache configs sitll contains the same setting about permissionAccessCache.
I did not go in any further detail examination, but I rather suppose this is still just planned but not done yet?

Regards Robert

andy
Champ on-the-rise
Champ on-the-rise
Hi

The cache is used when OLD style ACLs are found but not for new.
You need to look at all the code changes and not just see if the cache is still there 🙂

Andy