Package org.apache.jackrabbit.core.security.authorization

Examples of org.apache.jackrabbit.core.security.authorization.UnmodifiableAccessControlList


        // if the given node is access-controlled, construct a new ACL and add
        // it to the list
        if (isAccessControlled(node)) {
            if (permissions.grants(node.getPrimaryPath(), Permission.READ_AC)) {
                // retrieve the entries for the access controlled node
                acls.add(new UnmodifiableAccessControlList(entryCollector.getEntries(node), node.getPath(), Collections.<String, Integer>emptyMap()));
            } else {
                throw new AccessDeniedException("Access denied at " + node.getPath());
            }
        }
        // then, recursively look for access controlled parents up the hierarchy.
View Full Code Here


        if (acls.isEmpty()) {
            // no access control information can be retrieved for the specified
            // node, since neither the node nor any of its parents is access
            // controlled -> build a default policy.
            log.warn("No access controlled node present in item hierarchy starting from " + targetNode.getPath());
            acls.add(new UnmodifiableAccessControlList(Collections.EMPTY_LIST));
        }
        return (AccessControlList[]) acls.toArray(new AccessControlList[acls.size()]);
    }
View Full Code Here

        // it to the list
        if (isAccessControlled(node)) {
            // build acl for the access controlled node
            NodeImpl aclNode = node.getNode(N_POLICY);
            AccessControlList acl = systemEditor.getACL(aclNode);
            acls.add(new UnmodifiableAccessControlList(acl));
        }
        // then, recursively look for access controlled parents up the hierarchy.
        if (!rootNodeId.equals(node.getId())) {
            NodeImpl parentNode = (NodeImpl) node.getParent();
            collectAcls(parentNode, acls);
View Full Code Here

            NodeImpl aclNode = (NodeImpl) it.nextNode().getParent();
            NodeImpl accessControlledNode = (NodeImpl) aclNode.getParent();
           
            if (isAccessControlled(accessControlledNode)) {
                if (permissions.canRead(aclNode.getPrimaryPath(), aclNode.getNodeId())) {
                    acls.add(new UnmodifiableAccessControlList(entryCollector.getEntries(accessControlledNode), accessControlledNode.getPath(), Collections.<String, Integer>emptyMap()));
                } else {
                    throw new AccessDeniedException("Access denied at " + Text.getRelativeParent(aclNode.getPath(), 1));
                }
            }
        }
View Full Code Here

        // if the given node is access-controlled, construct a new ACL and add
        // it to the list
        if (isAccessControlled(node)) {
            if (permissions.grants(node.getPrimaryPath(), Permission.READ_AC)) {
                // retrieve the entries for the access controlled node
                acls.add(new UnmodifiableAccessControlList(entryCollector.getEntries(node), node.getPath(), Collections.<String, Integer>emptyMap()));
            } else {
                throw new AccessDeniedException("Access denied at " + node.getPath());
            }
        }
        // then, recursively look for access controlled parents up the hierarchy.
View Full Code Here

    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);

        return new UnmodifiableAccessControlList(acl);
    }
View Full Code Here

           is defined to express a best-effor estimate only.
        */
        AccessControlPolicy[] tmpls = editor.getPolicies(session.getJCRPath(absPath));
        AccessControlPolicy[] effectives = new AccessControlPolicy[tmpls.length];
        for (int i = 0; i < tmpls.length; i++) {
            effectives[i] = new UnmodifiableAccessControlList((ACLTemplate) tmpls[i]);
        }
        return effectives;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.security.authorization.UnmodifiableAccessControlList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.