Examples of removeMember()


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

        try {
            assertFalse(gr.addMember(cU));
        } catch (AccessDeniedException e) {
            // ok
        } finally {
            gr.removeMember(cU);
        }
    }

    public void testAddChildToGroup2() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(uSession);
View Full Code Here

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

        try {
            assertTrue(userAdmin.addMember(self));

            Group gr = (Group) umgr.getAuthorizable(groupAdmin.getID());
            assertTrue(gr.addMember(cU));
            assertTrue(gr.removeMember(cU));
        } finally {
            userAdmin.removeMember(self);
        }
    }
View Full Code Here

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

            assertFalse(testGroup.isMember(testUser));
            assertTrue(testGroup.addMember(testUser));
        } finally {
            if (testGroup != null) {
                for (Iterator it = testGroup.getDeclaredMembers(); it.hasNext();) {
                    testGroup.removeMember((Authorizable) it.next());
                }
                testGroup.remove();
            }
            userAdmin.removeMember(self);           
        }
View Full Code Here

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

        try {
            assertFalse(gr.addMember(pU));
        } catch (AccessDeniedException e) {
            // ok
        } finally {
            gr.removeMember(pU);
        }

        // ... even if the editing user becomes member of the user-admin group
        Group uAdministrators = null;
        try {
View Full Code Here

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

            }
        } finally {
            // let superuser do the clean up.
            // remove testuser from u-admin group again.
            if (uAdministrators != null) {
                uAdministrators.removeMember(userMgr.getAuthorizable(uID));
            }
        }
    }

    public void testAddOwnAuthorizableAsGroupAdmin() throws RepositoryException, NotExecutableException {
View Full Code Here

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

        Authorizable user = umgr.getAuthorizable(uID);
        Group gr = (Group) umgr.getAuthorizable(groupAdmin.getID());

        // removing himself from group. should succeed.
        assertTrue(gr.removeMember(user));
    }

    public void testAddOwnAuthorizableToForeignGroup() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(uSession);
View Full Code Here

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

            throw new RepositoryException("Test user is already member -> cannot execute.");
        }

        String msg = "GroupAdmin must be able to add its own authorizable to a group she/he is not yet member of.";
        assertTrue(msg, uadminGr.addMember(user));
        assertTrue(msg, uadminGr.removeMember(user));
    }

    public void testRemoveMembersOfForeignGroup() throws RepositoryException, NotExecutableException {
        Group nGr = null;
        User nUs = null;
View Full Code Here

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

            Iterator it = gr.getMembers();
            if (it.hasNext()) {
                Authorizable auth = (Authorizable) it.next();

                String msg = "GroupAdmin cannot remove members of other user unless he/she is user-admin.";
                assertFalse(msg, gr.removeMember(auth));
            } else {
                throw new RepositoryException("Must contain members....");
            }

        } catch (AccessDeniedException e) {
View Full Code Here

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

            Authorizable a = userMgr.getAuthorizable(otherUID);
            if (a != null) {
                for (Iterator it = a.memberOf(); it.hasNext();) {
                    Group gr = (Group) it.next();
                    if (!gr.getPrincipal().equals(EveryonePrincipal.getInstance())) {
                        gr.removeMember(a);
                    }
                }
                a.remove();
            }
            a = userMgr.getAuthorizable(uID);
View Full Code Here

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

            // since uSession is not user-admin this must fail.
            for (Iterator it = gr.getMembers(); it.hasNext();) {
                Authorizable auth = (Authorizable) it.next();

                String msg = "GroupAdmin cannot remove members of groups unless he/she is UserAdmin.";
                assertFalse(msg, gr.removeMember(auth));
            }
        } catch (AccessDeniedException e) {
            // fine as well.
        } finally {
            // let superuser remove authorizables again
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.