Package org.apache.jackrabbit.api.security.user

Examples of org.apache.jackrabbit.api.security.user.Group.addMember()


            gr2 = userMgr.createGroup(getTestPrincipal());
            save(superuser);


            gr1.addMember(gr2);
            gr2.addMember(u);
            save(superuser);

            PrincipalIterator it = principalProvider.getGroupMembership(u.getPrincipal());
            while (it.hasNext()) {
                Principal p = it.nextPrincipal();
View Full Code Here


            superuser.save();

            assertFalse(everyone.addMember(anotherGroup));
            assertFalse(everyone.removeMember(anotherGroup));

            assertFalse(anotherGroup.addMember(everyone));
            assertFalse(anotherGroup.removeMember(everyone));

        } finally {
            if (anotherGroup != null) {
                anotherGroup.remove();
View Full Code Here

            assertEquals(0, ((RangeIterator) groups).getSize());
            groups = auth.memberOf();
            assertTrue(groups instanceof RangeIterator);
            assertEquals(0, ((RangeIterator) groups).getSize());

            group.addMember(auth);
            groups = auth.declaredMemberOf();
            assertTrue(groups instanceof RangeIterator);
            assertEquals(1, ((RangeIterator) groups).getSize());

            groups = auth.memberOf();
View Full Code Here

            assertFalse(newGroup.isMember(auth));
            assertFalse(newGroup.removeMember(auth));
            superuser.save();

            assertTrue(newGroup.addMember(auth));
            superuser.save();
            assertTrue(newGroup.isMember(auth));
            assertTrue(newGroup.isMember(userMgr.getAuthorizable(auth.getID())));

        } finally {
View Full Code Here

                users.add(userMgr.createUser("user_" + k, "pass_" + k));
            }
            superuser.save();

            for (User user : users) {
                assertTrue(newGroup.addMember(user));
            }
            superuser.save();

            for (User user : users) {
                assertTrue(newGroup.isMember(user));
View Full Code Here

            assertTrue(newGroup1.addMember(auth));
            superuser.save();
            assertTrue(newGroup1.isMember(auth));
            assertTrue(newGroup1.isMember(userMgr.getAuthorizable(auth.getID())));

            assertTrue(newGroup2.addMember(auth));
            superuser.save();
            assertTrue(newGroup2.isMember(auth));
            assertTrue(newGroup2.isMember(userMgr.getAuthorizable(auth.getID())));

            assertTrue(newGroup1.removeMember(auth));
View Full Code Here

            superuser.save();

            assertFalse(newGroup1.isDeclaredMember(auth));
            assertFalse(newGroup2.isDeclaredMember(auth));

            assertTrue(newGroup2.addMember(auth));
            superuser.save();
            assertTrue(newGroup2.isDeclaredMember(auth));
            assertTrue(newGroup2.isDeclaredMember(userMgr.getAuthorizable(auth.getID())));

            assertTrue(newGroup1.addMember(newGroup2));
View Full Code Here

        Group newGroup = null;
        try {
            newGroup = userMgr.createGroup(getTestPrincipal());
            superuser.save();

            assertTrue(newGroup.addMember(auth));
            superuser.save();
            assertFalse(newGroup.addMember(auth));
            superuser.save();
            assertTrue(newGroup.isMember(auth));
View Full Code Here

            newGroup = userMgr.createGroup(getTestPrincipal());
            superuser.save();

            assertTrue(newGroup.addMember(auth));
            superuser.save();
            assertFalse(newGroup.addMember(auth));
            superuser.save();
            assertTrue(newGroup.isMember(auth));

        } finally {
            if (newGroup != null) {
View Full Code Here

        try {
            newGroup = userMgr.createGroup(getTestPrincipal());
            superuser.save();

            assertFalseMemberOfContainsGroup(auth.memberOf(), newGroup);
            assertTrue(newGroup.addMember(auth));
            superuser.save();

            assertTrueMemberOfContainsGroup(auth.declaredMemberOf(), newGroup);
            assertTrueMemberOfContainsGroup(auth.memberOf(), newGroup);
        } finally {
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.