Package javax.jcr.security

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


            // ok.
        }

        /* Finally the test user must not be allowed to remove the policy. */
        try {
            testAcMgr.removePolicy(path, new AccessControlPolicy() {});
            fail("Test user must not be allowed to remove the access control policy.");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here


            fail("test user must not have READ_AC privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
        try {
            testAcMgr.removePolicy(tmpl.getPath(), new AccessControlPolicy() {});
            fail("test user must not have MODIFY_AC privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here

        assertTrue(testAcMgr.hasPrivileges(path,
                privilegesFromName(Privilege.JCR_REMOVE_CHILD_NODES)));

        // 2) remove the policy
        testAcMgr.removePolicy(path, policies[0]);
        testSession.save();

        // Finally: testuser removed the policy that granted him permission
        // to modify the AC content. Since testuser removed the policy, it's
        // privileges must be gone again...
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

            // ok.
        }

        /* Finally the test user must not be allowed to remove the policy. */
        try {
            testAcMgr.removePolicy(path, new AccessControlPolicy() {});
            fail("Test user must not be allowed to remove the access control policy.");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here

            fail("test user must not have READ_AC privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
        try {
            testAcMgr.removePolicy(tmpl.getPath(), new AccessControlPolicy() {});
            fail("test user must not have MODIFY_AC privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here

        } finally {
            acl.addAccessControlEntry(SimplePrincipal.EVERYONE, new Privilege[] {acm.privilegeFromName(Privilege.JCR_ALL)});
            acm.setPolicy("/parent/child1", acl);
            session.save();

            acm.removePolicy("/parent/child1", null);
            parent.remove();
            session.save();
        }
    }
View Full Code Here

            acm.setPolicy("/testNode/node2", aclNode2);

            session.save();
            assertTrue(repository.repositoryCache().isAccessControlEnabled());

            acm.removePolicy("/testNode/node1", null);
            acm.removePolicy("/testNode/node2", null);
            session.save();
            assertFalse(repository.repositoryCache().isAccessControlEnabled());
        } finally {
            session.logout();
View Full Code Here

            session.save();
            assertTrue(repository.repositoryCache().isAccessControlEnabled());

            acm.removePolicy("/testNode/node1", null);
            acm.removePolicy("/testNode/node2", null);
            session.save();
            assertFalse(repository.repositoryCache().isAccessControlEnabled());
        } finally {
            session.logout();
        }
View Full Code Here

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

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