use of org.apache.jackrabbit.oak.spi.security.principal.PrincipalIteratorAdapter in project jackrabbit-oak by apache.
the class ImpersonationImpl method getImpersonators.
// ------------------------------------------------------< Impersonation >---
/**
* @see org.apache.jackrabbit.api.security.user.Impersonation#getImpersonators()
*/
@Nonnull
@Override
public PrincipalIterator getImpersonators() throws RepositoryException {
Set<String> impersonators = getImpersonatorNames();
if (impersonators.isEmpty()) {
return PrincipalIteratorAdapter.EMPTY;
} else {
Set<Principal> s = new HashSet<Principal>();
for (final String pName : impersonators) {
Principal p = principalManager.getPrincipal(pName);
if (p == null) {
log.debug("Impersonator " + pName + " does not correspond to a known Principal.");
p = new PrincipalImpl(pName);
}
s.add(p);
}
return new PrincipalIteratorAdapter(s);
}
}
Aggregations