Search in sources :

Example 6 with PrincipalRelationship

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());
}
Also used : PrincipalKeys(com.enonic.xp.security.PrincipalKeys) PrincipalRelationship(com.enonic.xp.security.PrincipalRelationship) Principals(com.enonic.xp.security.Principals) PrincipalKey(com.enonic.xp.security.PrincipalKey) PrincipalRelationships(com.enonic.xp.security.PrincipalRelationships)

Aggregations

PrincipalKey (com.enonic.xp.security.PrincipalKey)6 PrincipalRelationship (com.enonic.xp.security.PrincipalRelationship)6 PrincipalRelationships (com.enonic.xp.security.PrincipalRelationships)4 AbstractElasticsearchIntegrationTest (com.enonic.xp.repo.impl.elasticsearch.AbstractElasticsearchIntegrationTest)3 CreateGroupParams (com.enonic.xp.security.CreateGroupParams)3 CreateUserParams (com.enonic.xp.security.CreateUserParams)3 Test (org.junit.jupiter.api.Test)3 PrincipalKeys (com.enonic.xp.security.PrincipalKeys)2 Property (com.enonic.xp.data.Property)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 UpdateNodeParams (com.enonic.xp.node.UpdateNodeParams)1 Principals (com.enonic.xp.security.Principals)1 ImmutableList (com.google.common.collect.ImmutableList)1