Examples of nextPrincipal()


Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        // of principals (as in the Subject).
        Set<Principal> principals = new LinkedHashSet<Principal>();
        principals.add(principal);
        PrincipalIterator groups = principalProvider.getGroupMembership(principal);
        while (groups.hasNext()) {
            principals.add(groups.nextPrincipal());
        }
        return principals;
    }

    //--------------------------------------------------------------------------
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        }

        PrincipalManager pMgr = ((JackrabbitSession) superuser).getPrincipalManager();
        PrincipalIterator it = pMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
        if (it.hasNext()) {
            return it.nextPrincipal();
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

    @Test
    public void testExistingPrincipal() throws Exception {
        Principal existing = null;
        PrincipalIterator principalIterator = ((JackrabbitSession) adminSession).getPrincipalManager().getPrincipals(PrincipalManager.SEARCH_TYPE_ALL);
        while (principalIterator.hasNext()) {
            Principal p = principalIterator.nextPrincipal();
            if (userMgr.getAuthorizable(p) != null) {
                existing = p;
                break;
            }
        }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        // of principals (as in the Subject).
        Set<Principal> principals = new LinkedHashSet<Principal>();
        principals.add(principal);
        PrincipalIterator groups = principalProvider.getGroupMembership(principal);
        while (groups.hasNext()) {
            principals.add(groups.nextPrincipal());
        }
        return principals;
    }

    //--------------------------------------------------------------------------
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

    @Override
    public Principal getKnownPrincipal(Session session) throws RepositoryException {
        if (session instanceof JackrabbitSession) {
            PrincipalIterator principals = ((JackrabbitSession) session).getPrincipalManager().getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
            if (principals.hasNext()) {
                return principals.nextPrincipal();
            }
        }

        throw new UnsupportedRepositoryOperationException();
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

    @Override
    public Principal getKnownPrincipal(Session session) throws RepositoryException {
        if (session instanceof JackrabbitSession) {
            PrincipalIterator principals = ((JackrabbitSession) session).getPrincipalManager().getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
            if (principals.hasNext()) {
                return principals.nextPrincipal();
            }
        }

        throw new UnsupportedRepositoryOperationException();
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        PrincipalIterator pit = principalProvider.getGroupMembership(userPrincipal);

        // unknown user must be in 'everyone' group but nothing else
        assertTrue(pit.hasNext());
        assertEquals(EveryonePrincipal.getInstance(), pit.nextPrincipal());
        assertFalse(pit.hasNext());
    }

    public void testInheritedMemberShip() throws RepositoryException, NotExecutableException {
        Principal up = getTestPrincipal();
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

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

            PrincipalIterator it = principalProvider.getGroupMembership(u.getPrincipal());
            while (it.hasNext()) {
                Principal p = it.nextPrincipal();
                if (p.equals(gr1.getPrincipal())) {
                    // success return
                    return;
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        // of principals (as in the Subject).
        Set<Principal> principals = new LinkedHashSet<Principal>();
        principals.add(principal);
        PrincipalIterator groups = principalProvider.getGroupMembership(principal);
        while (groups.hasNext()) {
            principals.add(groups.nextPrincipal());
        }
        return principals;
    }

    //--------------------------------------------------------------------------
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        }

        PrincipalManager pMgr = ((JackrabbitSession) superuser).getPrincipalManager();
        PrincipalIterator it = pMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
        if (it.hasNext()) {
            return it.nextPrincipal();
        } else {
            throw new NotExecutableException();
        }
    }
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.