/** * * @param aclNode the node * @param path * @return the control list * @throws RepositoryException if an error occurs */ ACLTemplate getACL(NodeImpl aclNode, String path) throws RepositoryException { return new ACLTemplate(aclNode, path, allowUnknownPrincipals); }
/** * * @param aclNode the node * @param path * @return the control list * @throws RepositoryException if an error occurs */ ACLTemplate getACL(NodeImpl aclNode, String path) throws RepositoryException { return new ACLTemplate(aclNode, path, allowUnknownPrincipals); }
private AccessControlList getACL(NodeImpl accessControlledNode, Name policyName, String path) throws RepositoryException { // collect the aces of that node. NodeImpl aclNode = accessControlledNode.getNode(policyName); AccessControlList acl = new ACLTemplate(aclNode, path, allowUnknownPrincipals); return new UnmodifiableAccessControlList(acl); }
private AccessControlList getACL(NodeImpl accessControlledNode, Name policyName, String path) throws RepositoryException { // collect the aces of that node. NodeImpl aclNode = accessControlledNode.getNode(policyName); AccessControlList acl = new ACLTemplate(aclNode, path, allowUnknownPrincipals); return new UnmodifiableAccessControlList(acl); }
@Override protected JackrabbitAccessControlList createEmptyTemplate(String path) throws RepositoryException { SessionImpl sImpl = (SessionImpl) superuser; return new ACLTemplate(path, principalMgr, privilegeMgr, sImpl.getValueFactory(), sImpl, false); }
/** * Returns stored entriesInheriting flag for given node */ private boolean isEntriesInheriting( final NodeImpl node ) throws RepositoryException { NodeImpl aclNode = node.getNode( AccessControlConstants.N_POLICY ); String path = aclNode != null ? aclNode.getParent().getPath() : null; return JcrRepositoryFileAclUtils.getAclMetadata( session, node.getPath(), new ACLTemplate( aclNode, path, false /* allowUnknownPrincipals */ ) ).isEntriesInheriting(); }
/** * Find the ancestor (maybe the node itself) that is not inheriting ACEs. */ protected NodeImpl findNonInheritingNode( final NodeImpl node ) throws RepositoryException { NodeImpl currentNode = node; ACLTemplate acl; while ( true ) { currentNode = findAccessControlledNode( currentNode ); NodeImpl aclNode = currentNode.getNode( N_POLICY ); String path = aclNode != null ? aclNode.getParent().getPath() : null; acl = new ACLTemplate( aclNode, path, false /* allowUnknownPrincipals */ ); // skip all nodes that are inheriting AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( systemSession, currentNode.getPath(), acl ); if ( aclMetadata != null && aclMetadata.isEntriesInheriting() ) { currentNode = (NodeImpl) currentNode.getParent(); continue; } break; } return currentNode; }
@Override protected void setUp() throws Exception { super.setUp(); SessionImpl s = (SessionImpl) superuser; PrivilegeManager privMgr = ((JackrabbitWorkspace) superuser.getWorkspace()).getPrivilegeManager(); acl = new ACLTemplate(testPath, s.getPrincipalManager(), privMgr, s.getValueFactory(), s, false); }
PrivilegeManager privMgr = ((JackrabbitWorkspace) session.getWorkspace()).getPrivilegeManager(); if (controlledNode.isNodeType(mixin) || controlledNode.canAddMixin(mixin)) { acl = new ACLTemplate(nodePath, session.getPrincipalManager(), privMgr, session.getValueFactory(), session, allowUnknownPrincipals); } else {
PrivilegeManager privMgr = ((JackrabbitWorkspace) session.getWorkspace()).getPrivilegeManager(); if (controlledNode.isNodeType(mixin) || controlledNode.canAddMixin(mixin)) { acl = new ACLTemplate(nodePath, session.getPrincipalManager(), privMgr, session.getValueFactory(), session, allowUnknownPrincipals); } else {
acl = new ACLTemplate( currentNode.getNode( N_POLICY ), currentNode.getPath(), false /* allowUnknownPrincipals */ ); acl = new ACLTemplate( currentNode.getNode( N_POLICY ), currentNode.getPath(), false /* allowUnknownPrincipals */ ); if ( firstAccessControlledNode.isSame( currentNode ) && !rootID.equals( currentNode.getNodeId() ) ) { NodeImpl ancestorNode = findNonInheritingNode( (NodeImpl) currentNode.getParent() ); ancestorAcl = new ACLTemplate( ancestorNode.getNode( N_POLICY ), ancestorNode.getPath(), false /* allowUnknownPrincipals */ );