Examples of UnmodifiableAccessControlList


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

        // it to the list
        if (isAccessControlled(node)) {
            if (permissions.grants(node.getPrimaryPath(), Permission.READ_AC)) {
                // retrieve the entries for the access controlled node
                List<AccessControlEntry> aces = entryCollector.getEntries(node).getACEs();
                acls.add(new UnmodifiableAccessControlList(aces, 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

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

                ACLTemplate acl = (ACLTemplate) policies[0];
                for (AccessControlEntry ace : acl.getAccessControlEntries()) {
                    ACLTemplate.Entry entry = (ACLTemplate.Entry) ace;
                    if (entry.matches(jcrPath)) {
                        if (permissions.grants(acPath, Permission.READ_AC)) {
                            acls.add(new UnmodifiableAccessControlList(acl));
                            break;
                        } else {
                            throw new AccessDeniedException("Access denied at " + accessControlledNodePath);
                        }
                    }
View Full Code Here

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

        List<AccessControlPolicy> acls = new ArrayList<AccessControlPolicy>(principals.size());
        for (Principal principal : principals) {
            ACLTemplate acl = editor.getACL(principal);
            if (acl != null) {
                if (permissions.grants(session.getQPath(acl.getPath()), Permission.READ_AC)) {
                    acls.add(new UnmodifiableAccessControlList(acl));
                } else {
                    throw new AccessDeniedException("Access denied at " + acl.getPath());
                }
            }
        }
View Full Code Here

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

    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

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

    public AccessControlPolicy[] getEffectivePolicies(Path absPath)
            throws ItemNotFoundException, RepositoryException {
        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

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

    public AccessControlPolicy[] getEffectivePolicies(Path absPath)
            throws ItemNotFoundException, RepositoryException {
        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

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

        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

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

        // 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

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

    private void collectAcls(NodeImpl node, List<AccessControlList> acls) throws RepositoryException {
        // if the given node is access-controlled, construct a new ACL and add
        // it to the list
        if (isAccessControlled(node)) {
            // retrieve the entries for the access controlled node
            acls.add(new UnmodifiableAccessControlList(entryCollector.getEntries(node), node.getPath(), Collections.<String, Integer>emptyMap()));
        }
        // 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

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

            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
TOP
Copyright © 2018 www.massapi.com. 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.