Examples of nextAccessControlPolicy()


Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

        /*
         testuser must be allowed to set a new policy at a child node.
        */
        AccessControlPolicyIterator it = testAcMgr.getApplicablePolicies(childNPath);
        while (it.hasNext()) {
            AccessControlPolicy plc = it.nextAccessControlPolicy();
            testAcMgr.setPolicy(childNPath, plc);
            testSession.save();
            testAcMgr.removePolicy(childNPath, plc);
            testSession.save();
        }
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

    }

    private ACL getApplicablePolicy(@Nullable String path) throws RepositoryException {
        AccessControlPolicyIterator itr = acMgr.getApplicablePolicies(path);
        if (itr.hasNext()) {
            return (ACL) itr.nextAccessControlPolicy();
        } else {
            throw new RepositoryException("No applicable policy found.");
        }
    }
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

        AccessControlPolicyIterator itr = acMgr.getApplicablePolicies(testPath);

        assertNotNull(itr);
        assertTrue(itr.hasNext());

        AccessControlPolicy policy = itr.nextAccessControlPolicy();
        assertNotNull(policy);
        assertTrue(policy instanceof ACL);

        ACL acl = (ACL) policy;
        assertTrue(acl.isEmpty());
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

    protected JackrabbitAccessControlList getPolicy(AccessControlManager acM, String path, Principal principal) throws RepositoryException, AccessDeniedException, NotExecutableException {
        // first try if there is a new applicable policy
        AccessControlPolicyIterator it = acM.getApplicablePolicies(path);
        while (it.hasNext()) {
            AccessControlPolicy acp = it.nextAccessControlPolicy();
            if (acp instanceof ACLTemplate) {
                return (ACLTemplate) acp;
            }
        }
        // try if there is an acl that has been set before:
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

        SessionImpl s = (SessionImpl) n.getSession();
        JackrabbitAccessControlList acl = null;
        AccessControlManager acMgr = s.getAccessControlManager();
        AccessControlPolicyIterator it = acMgr.getApplicablePolicies(n.getPath());
        while (it.hasNext()) {
            AccessControlPolicy acp = it.nextAccessControlPolicy();
            if (acp instanceof JackrabbitAccessControlList) {
                acl = (JackrabbitAccessControlList) acp;
                break;
            }
        }
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

    }

    private JackrabbitAccessControlList getACL(String path) throws RepositoryException, AccessDeniedException, NotExecutableException {
        AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path);
        while (it.hasNext()) {
            AccessControlPolicy acp = it.nextAccessControlPolicy();
            if (acp instanceof JackrabbitAccessControlList) {
                return (JackrabbitAccessControlList) acp;
            }
        }
        throw new NotExecutableException("No JackrabbitAccessControlList found at " + path + " .");
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

        Node n = testRootNode.addNode(nodeName1, testNodeType);
        superuser.save();

        AccessControlPolicyIterator it = acMgr.getApplicablePolicies(n.getPath());
        while (it.hasNext() && templ == null) {
            AccessControlPolicy p = it.nextAccessControlPolicy();
            if (p instanceof JackrabbitAccessControlList) {
                templ = (JackrabbitAccessControlList) p;
            }
        }
        if (templ == null) {
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

    static JackrabbitAccessControlList getPolicy(AccessControlManager acM, String path, Principal principal) throws RepositoryException,
            AccessDeniedException, NotExecutableException {
        // try applicable (new) acls first
        AccessControlPolicyIterator itr = acM.getApplicablePolicies(path);
        while (itr.hasNext()) {
            AccessControlPolicy policy = itr.nextAccessControlPolicy();
            if (policy instanceof ACLTemplate) {
                return (ACLTemplate) policy;
            }
        }
        // try if there is an acl that has been set before:
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

    protected JackrabbitAccessControlList getPolicy(AccessControlManager acM, String path, Principal principal) throws RepositoryException, AccessDeniedException, NotExecutableException {
        // first try if there is a new applicable policy
        AccessControlPolicyIterator it = acM.getApplicablePolicies(path);
        while (it.hasNext()) {
            AccessControlPolicy acp = it.nextAccessControlPolicy();
            if (acp instanceof ACLTemplate) {
                return (ACLTemplate) acp;
            }
        }
        // try if there is an acl that has been set before:
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.nextAccessControlPolicy()

    public void testNodeIsModifiedAfterSecondSetPolicy() throws RepositoryException, AccessDeniedException, NotExecutableException {
        checkCanModifyAc(path);
        // make sure a policy has been explicitely set.
        AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path);
        if (it.hasNext()) {
            AccessControlPolicy policy = it.nextAccessControlPolicy();
            acMgr.setPolicy(path, policy);
            superuser.save();
            // remember for tearDown
            addedPolicies.put(path, policy);
        } else {
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.