jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Seidel. Robert" <Robert.Sei...@aeb.de>
Subject AW: More than one policy per node?
Date Wed, 05 Jan 2011 10:30:18 GMT
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:anchela@adobe.com] 
Gesendet: Mittwoch, 5. Januar 2011 10:49
An: users@jackrabbit.apache.org
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

Mime
View raw message