use of com.enonic.xp.security.PrincipalRelationship in project xp by enonic.
the class GetMembersHandler method getMembers.
public List<PrincipalMapper> getMembers() {
final PrincipalRelationships relationships = this.securityService.get().getRelationships(this.principalKey);
final PrincipalKeys principalKeys = PrincipalKeys.from(relationships.stream().map(PrincipalRelationship::getTo).toArray(PrincipalKey[]::new));
final Principals principals = this.securityService.get().getPrincipals(principalKeys);
return principals.stream().map(PrincipalMapper::new).collect(Collectors.toList());
}
Aggregations