Examples of createGroup()


Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

       
        UserManager userMgr = getUserManager(root);
        try {
            group1 = userMgr.createGroup("group1");
            group2 = userMgr.createGroup("group2");
            group3 = userMgr.createGroup("group3");

            group1.addMember(group2);
            group2.addMember(group3);
           
            assertFalse(group3.addMember(group1));
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

    @Test
    public void testAccessControlAction() throws Exception {
        UserManager userMgr = getUserManager(root);
        Group gr = null;
        try {
            gr = userMgr.createGroup("actionTestGroup");
            root.commit();

            assertAcAction(gr, PrivilegeConstants.JCR_READ);
        } finally {
            root.refresh();
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

    public void before() throws Exception {
        super.before();

        new NodeUtil(root.getTree("/")).addChild("test", JcrConstants.NT_UNSTRUCTURED);
        UserManager uMgr = getUserManager(root);
        adminstrators = uMgr.createGroup(ADMINISTRATOR_GROUP);
        root.commit();
    }

    @Override
    public void after() throws Exception {
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

    }

    public void testCreateGroup() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal());
            fail("UserAdmin should not be allowed to create a new Group.");
            testGroup.remove();
        } catch (RepositoryException e) {
            // success.
        }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

    }

    public void testCreateGroupWithIntermediatePath() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            fail("UserAdmin should not be allowed to create a new Group.");
            testGroup.remove();
        } catch (RepositoryException e) {
            // success.
        }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

    public void testCreateGroup() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(uSession);
        Group testGroup = null;
        try {
            testGroup = umgr.createGroup(getTestPrincipal());
            assertTrue(Text.isDescendant(UserConstants.GROUPS_PATH, ((GroupImpl)testGroup).getNode().getPath()));
        } finally {
            if (testGroup != null) {
                testGroup.remove();
            }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

    public void testCreateGroupWithIntermediatePath() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(uSession);
        Group testGroup = null;
        try {
            testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            assertTrue(Text.isDescendant(UserConstants.GROUPS_PATH + "/any/intermediate/path", ((GroupImpl)testGroup).getNode().getPath()));
        } finally {
            if (testGroup != null) {
                testGroup.remove();
            }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

        Group userAdmin = (Group) auth;
        Group testGroup = null;
        User self = (User) umgr.getAuthorizable(uID);
        try {
            // let groupadmin create a new group
            testGroup = umgr.createGroup(getTestPrincipal(), "/a/b/c/d");

            // editing session adds itself to that group -> must succeed.
            assertTrue(testGroup.addMember(self));

            // editing session adds itself to user-admin group
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);
        try {
            group2.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
                superuser.save();
            }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.UserManager.createGroup()

        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);

        try {
            group2.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
                superuser.save();
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.