Hi

> i don't find it too difficult to think of
some other approach that would make heavy use of multiple policies
per node.

Indeed, I can think of such scenarios too, but every other jackrabbit user have 
to implement a helper method like the one below to get the one policy that 
counts - this method could be standard at the AccessControlManager without 
taking the possibility to use multiple policies per node:

        AccessControlList getList(AccessControlManager acMgr,
                        String path) throws AccessDeniedException, 
RepositoryException {
                for (AccessControlPolicyIterator it = 
acMgr.getApplicablePolicies(path); it
                                .hasNext();) {
                        AccessControlPolicy acp = it.nextAccessControlPolicy();
                        if (acp instanceof AccessControlList) {
                                return (AccessControlList) acp;
                        }
                }
                AccessControlPolicy[] acps = acMgr.getPolicies(path);
                for (int i = 0; i < acps.length; i++) {
                        if (acps[i] instanceof AccessControlList) {
                                return (AccessControlList) acps[i];
                        }
                }
                throw new RepositoryException("No AccessControlList at " + 
path);
        }

Regards, Robert

-----Ursprüngliche Nachricht-----
Von: Angela Schreiber [mailto:[email protected]] 
Gesendet: Mittwoch, 5. Januar 2011 10:49
An: [email protected]
Betreff: Re: More than one policy per node?

hi

> In which cases do I have more than one policy per node?

with the *current* implementation in jr there is only one policy
per node. but e.g. JCR-2331 would most probably be implemented
by having an additional non-editable policy. similarly having
a specific implementation for READ-access restriction could be
thought of as additional policy that only takes effect under
certain circumstances. and last but not least another jcr
implementation could be built on a different ac model that doesn't
use accesscontrollists. i don't find it too difficult to think of
some other approach that would make heavy use of multiple policies
per node.

regards
angela

Reply via email to