Package javax.jcr.security

Examples of javax.jcr.security.AccessControlManager.removePolicy()


                Session session = repository.login();
                AccessControlManager acm = session.getAccessControlManager();
                // TODO author=Horia Chiorean date=25-Mar-14 description=Why null here !?!
                acm.removePolicy("/testNode/node1", null);
                acm.removePolicy("/testNode/node2", null);
                session.save();

                assertFalse(repository.runningState().repositoryCache().isAccessControlEnabled());

                session.getNode("/testNode").remove();
View Full Code Here


                // remove all ACLs
                JcrSession session = repository.login();
                AccessControlManager acm = session.getAccessControlManager();
                // TODO author=Horia Chiorean date=25-Mar-14 description=Why null ?!
                acm.removePolicy("/testNode", null);
                session.save();

                // remove the new property from 4.0 which actually stores the ACL count to simulate a pre 4.0 repository
                systemNode.removeProperty(systemSession, ModeShapeLexicon.ACL_COUNT);
                systemSession.save();
View Full Code Here

            }
            acMgr.setPolicy(path, policy);
        } else if (!path.contains("rep:policy")) {
            for (AccessControlPolicy policy : acMgr.getPolicies(path)) {
                if (policy instanceof JackrabbitAccessControlList) {
                    acMgr.removePolicy(path, policy);
                }
            }
        }
        node.getSession().save();
    }
View Full Code Here

                provider.validateRestrictions(path, t.getChild(REP_POLICY).getChild("allow"));
                fail("AccessControlException expected.");
            } catch (AccessControlException e) {
                // success
            } finally {
                acMgr.removePolicy(path, acl);
            }
        }
    }
}
View Full Code Here

            assertTrue(target.hasNode("rep:repoPolicy"));
            assertTrue(target.hasNode("rep:repoPolicy/allow"));

            // clean up again
            acMgr.removePolicy(null, policies[0]);
            assertFalse(target.hasNode("rep:repoPolicy"));
            assertFalse(target.hasNode("rep:repoPolicy/allow"));

        } finally {
            if (isSessionImport()) {
View Full Code Here

            // clean up policies at the root node
            AccessControlManager acMgr = getAccessControlManager(root);
            AccessControlPolicy[] policies = acMgr.getPolicies("/");
            for (AccessControlPolicy policy : policies) {
                acMgr.removePolicy("/", policy);
            }

            // remove all test content
            root.getTree("/a").remove();
            root.commit();
View Full Code Here

            }
            acMgr.setPolicy(path, policy);
        } else if (!path.contains("rep:policy")) {
            for (AccessControlPolicy policy : acMgr.getPolicies(path)) {
                if (policy instanceof JackrabbitAccessControlList) {
                    acMgr.removePolicy(path, policy);
                }
            }
        }
        node.getSession().save();
    }
View Full Code Here

            assertTrue(target.hasNode("rep:repoPolicy"));
            assertTrue(target.hasNode("rep:repoPolicy/allow"));

            // clean up again
            acMgr.removePolicy(null, policies[0]);
            assertFalse(target.hasNode("rep:repoPolicy"));
            assertFalse(target.hasNode("rep:repoPolicy/allow"));

        } finally {
            if (isSessionImport()) {
View Full Code Here

        try {
            // clean up policies at the root node
            AccessControlManager acMgr = getAccessControlManager(root);
            AccessControlPolicy[] policies = acMgr.getPolicies("/");
            for (AccessControlPolicy policy : policies) {
                acMgr.removePolicy("/", policy);
            }

            // remove all test content
            root.getTree("/a").remove();
            root.commit();
View Full Code Here

            assertTrue(target.hasNode("rep:repoPolicy"));
            assertTrue(target.hasNode("rep:repoPolicy/allow"));

            // clean up again
            acMgr.removePolicy(null, policies[0]);
            assertFalse(target.hasNode("rep:repoPolicy"));
            assertFalse(target.hasNode("rep:repoPolicy/allow"));

        } finally {
            superuser.refresh(false);
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.