jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angela Schreiber <anch...@day.com>
Subject Re: PrincipalManager question.
Date Wed, 01 Jul 2009 12:59:33 GMT
hi ian

> If I want to determine if the an Authorizable has a Principal 

what do you mean by "if an authorizable has a principal"?

in case you are referring to the fact that an authorizable
can have more than a single principal associated with it
there something like Authorizable#getPrincipals in the api.

see also Authorizable#addReferee and #removeReferee.

regards
angela



> (presumably witht the PrincipalManager), is there a way of doing this 
> with the DefaultSecurityManager in JR15 and later, other than iterating 
> through all the possible principals and searching for a match.
> We have uses that have a lot of principals, and getting them and 
> iterating is inefficient (IMHO), I would like to be able to perform a 
> search
> 
> eg
> /**
>  * @param myPrincipal the principal to be checked
>  * @param candidatePrincipal the principal that we are checking to see 
> if myPrincipal has
>  * @retrun true if myPrincipal has candidatePrincipal, false otherwise
>  */
> boolean principalManager.hasPrincipal(Principal myPrincipal, Principal 
> candidatePrincipal)
> 
> Ideally I would like that to propagate through to the PrincipalProviders 
> as this is really an search query that could be expensive.
> 
> Is there a way of achinving this *without* changing anyhing inside JR15 ?
> 
> Ian
> 


Mime
View raw message