Examples of memberOf()


Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

        Set<Principal> membership = new LinkedHashSet<Principal>();
            try {
                Authorizable auth = userManager.getAuthorizable(princ);
                if (auth != null) {
                    addToCache(princ);
                    Iterator<Group> itr = auth.memberOf();
                    while (itr.hasNext()) {
                        Group group = itr.next();
                        Principal gp = group.getPrincipal();
                        addToCache(gp);
                        membership.add(gp);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

            save(superuser);

            Iterator<Group>groups = auth.declaredMemberOf();
            assertTrue(groups instanceof RangeIterator);
            assertEquals(0, ((RangeIterator) groups).getSize());
            groups = auth.memberOf();
            assertTrue(groups instanceof RangeIterator);
            assertEquals(0, ((RangeIterator) groups).getSize());

            group.addMember(auth);
            groups = auth.declaredMemberOf();
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

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

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

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

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

        Set membership = new ListOrderedSet();
            try {
                Authorizable auth = userManager.getAuthorizable(princ);
                if (auth != null) {
                    addToCache(princ);
                    Iterator itr = auth.memberOf();
                    while (itr.hasNext()) {
                        Group group = (Group) itr.next();
                        Principal gp = group.getPrincipal();
                        addToCache(gp);
                        membership.add(gp);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

                    however, avoid putting the given 'princ' but assert that
                    the cached principal is obtained with the system session
                    used to deliver principals with this provider implementation.
                    */
                    addToCache(auth.getPrincipal());
                    Iterator<Group> itr = auth.memberOf();
                    while (itr.hasNext()) {
                        Group group = itr.next();
                        Principal gp = group.getPrincipal();
                        addToCache(gp);
                        membership.add(gp);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

    @Test
    public void testGetMembersAgainstMemberOf() throws NotExecutableException, RepositoryException {
        Iterator<Authorizable> it = group.getMembers();
        while (it.hasNext()) {
            Authorizable auth = it.next();
            assertTrueMemberOfContainsGroup(auth.memberOf(), group);
        }
    }

    @Test
    public void testGetDeclaredMembersAgainstDeclaredMemberOf() throws NotExecutableException, RepositoryException {
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

                    however, avoid putting the given 'princ' but assert that
                    the cached principal is obtained with the system session
                    used to deliver principals with this provider implementation.
                    */
                    addToCache(auth.getPrincipal());
                    Iterator<Group> itr = auth.memberOf();
                    while (itr.hasNext()) {
                        Group group = itr.next();
                        Principal gp = group.getPrincipal();
                        addToCache(gp);
                        membership.add(gp);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

                otherSession.logout();
            }
        } finally {
            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);
                    }
                }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

            superuser.save();

            Iterator<Group> groups = auth.declaredMemberOf();
            assertTrue(groups instanceof RangeIterator);
            assertEquals(0, ((RangeIterator) groups).getSize());
            groups = auth.memberOf();
            assertTrue(groups instanceof RangeIterator);
            assertEquals(0, ((RangeIterator) groups).getSize());

            group.addMember(auth);
            groups = auth.declaredMemberOf();
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Authorizable.memberOf()

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

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

        } finally {
            if (auth != null) {
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.