You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Arthur Taylor <ar...@gmail.com> on 2009/07/30 13:23:07 UTC
Permissions caching, DefaultAccessManager
Hi,
The DefaultAccessManager caches CompiledPermissions, and this cache
persists for the life of the session. Accessing Jackrabbit through
Sling, there's some additional session pooling so that sessions (and
therefore cached permissions) persist over requests.
This is causing an issue for us because it means that when we update
group membership (especially when we create new groups and add existing
users with existing sessions to those groups), the changes in
permissions are not reflected in the AccessManager for the
already-logged-in users.
There's a TODO in the DefaultAccessManager:
* TODO: if the users group-membership gets modified the
compiledPermissions
* TODO should ev. be recalculated. currently those modifications
are only
* TODO reflected upon re-login to the repository.
Are there any plans to make that change? If I wanted to tackle that,
where would be a good place to start?
Thanks,
Arthur
Re: Permissions caching, DefaultAccessManager
Posted by Angela Schreiber <an...@day.com>.
> I just wanted to be sure that there wasn't a less expensive
> approach first.
don't get me wrong:
i'm not saying that there isn't a less expensive
approach... when adding that TODO comment i simply
wasn't sure, if the Subject created upon login
should be changed in the first place.
in the second place i didn't immediately see a straight
forward solution to address this.
so the comment only documents that i was aware of
that - let's call it - limitation.
feel free to provide any kind of suggestions or
patches.
regards
angela
Re: Permissions caching, DefaultAccessManager
Posted by Arthur Taylor <ar...@gmail.com>.
Thanks for the reply,
> permission changes are diffent thing... the compiled
> permissions are intended to be notified and recalculated
> whenever the permissions for any of the principals it
> has been created for is modified. if that doesn't work
> it's a bug.
Agreed. I think permissions changes for existing principals are working
fine.
>
> what the TODO refers to is:
> the permissions are compiled for the set of principals
> that have been set to the Subject (most probably upon
> login). the default implementation retrieves the set
> from the principal provider configured for that login
> module... that's the reason for my doubts... forcing
> the recalculation of the compiled permissions was
> more or less straight forward: close the existing one
> and create a new one with the new set of principals.
The issue we have is that Sling maintains a session pool - we'd need to
ditch the entire session pool every time a new group was created in
order to be sure everyone was working with the same set of permissions.
Having recently-logged-in users see a different world to everybody else
is causing a fair bit of confusion.
I can try raising the issue with Sling. It might be that the best
approach is to have the session pool listen for principal creation /
removal. I just wanted to be sure that there wasn't a less expensive
approach first.
Thanks again for the help,
Arthur
Re: Permissions caching, DefaultAccessManager
Posted by Angela Schreiber <an...@day.com>.
Arthur Taylor wrote:
> Oh. I had read 'ev.' as 'evidently' :)
nice :)
> Absent changing that, then, is there any recommended mitigation
> strategy; should we be killing all open and cached sessions whenever
> there is a permissions change?
permission changes are diffent thing... the compiled
permissions are intended to be notified and recalculated
whenever the permissions for any of the principals it
has been created for is modified. if that doesn't work
it's a bug.
what the TODO refers to is:
the permissions are compiled for the set of principals
that have been set to the Subject (most probably upon
login). the default implementation retrieves the set
from the principal provider configured for that login
module... that's the reason for my doubts... forcing
the recalculation of the compiled permissions was
more or less straight forward: close the existing one
and create a new one with the new set of principals.
angela
Re: Permissions caching, DefaultAccessManager
Posted by Arthur Taylor <ar...@gmail.com>.
Oh. I had read 'ev.' as 'evidently' :)
Absent changing that, then, is there any recommended mitigation
strategy; should we be killing all open and cached sessions whenever
there is a permissions change?
Thanks,
Arthur
Angela Schreiber wrote:
> hi arthur
>
>> Are there any plans to make that change?
>
> not at the moment.
>
>> If I wanted to tackle that,
>> where would be a good place to start?
>
> not sure what would be the best approach... nor am i totally
> convinced that it should be changed....that's the 'eventually'
> in the TODO comment ;)
>
> regards
> angela
>
Re: Permissions caching, DefaultAccessManager
Posted by Angela Schreiber <an...@day.com>.
hi arthur
> Are there any plans to make that change?
not at the moment.
> If I wanted to tackle that,
> where would be a good place to start?
not sure what would be the best approach... nor am i totally
convinced that it should be changed....that's the 'eventually'
in the TODO comment ;)
regards
angela