auth-backend: update getDefaultOwnershipEntityRefs to only consider groups
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -42,7 +42,9 @@ import { CatalogIdentityClient } from '../catalog';
|
||||
export function getDefaultOwnershipEntityRefs(entity: Entity) {
|
||||
const membershipRefs =
|
||||
entity.relations
|
||||
?.filter(r => r.type === RELATION_MEMBER_OF)
|
||||
?.filter(
|
||||
r => r.type === RELATION_MEMBER_OF && r.targetRef.startsWith('group:'),
|
||||
)
|
||||
.map(r => r.targetRef) ?? [];
|
||||
|
||||
return Array.from(new Set([stringifyEntityRef(entity), ...membershipRefs]));
|
||||
|
||||
Reference in New Issue
Block a user