/** * @see org.apache.jackrabbit.core.security.principal.AbstractPrincipalIterator#seekNext() */ @Override protected Principal seekNext() { while (authorizableItr.hasNext()) { try { Principal p = authorizableItr.next().getPrincipal(); if (everyonePrincipal.equals(p)) { addEveryone = false; } addToCache(p); return p; } catch (RepositoryException e) { // should never get here log.warn("Error while retrieving principal from group -> skip."); } } if (addEveryone) { addEveryone = false; // make sure iteration stops return everyonePrincipal; } else { // end of iteration reached return null; } } }
/** * @see org.apache.jackrabbit.core.security.principal.AbstractPrincipalIterator#seekNext() */ @Override protected Principal seekNext() { while (authorizableItr.hasNext()) { try { Principal p = authorizableItr.next().getPrincipal(); if (everyonePrincipal.equals(p)) { addEveryone = false; } addToCache(p); return p; } catch (RepositoryException e) { // should never get here log.warn("Error while retrieving principal from group -> skip."); } } if (addEveryone) { addEveryone = false; // make sure iteration stops return everyonePrincipal; } else { // end of iteration reached return null; } } }
addToCache(auth.getPrincipal()); Iterator<Group> itr = auth.memberOf(); while (itr.hasNext()) { Group group = itr.next(); Principal gp = group.getPrincipal(); addToCache(gp); membership.add(gp);
addToCache(auth.getPrincipal()); Iterator<Group> itr = auth.memberOf(); while (itr.hasNext()) { Group group = itr.next(); Principal gp = group.getPrincipal(); addToCache(gp); membership.add(gp);