From cd0105ff42d66e7644a941e4ef7bc34b916b7268 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 12 Apr 2022 11:35:58 +0200 Subject: [PATCH] auth-backend: update getDefaultOwnershipEntityRefs to only consider groups Signed-off-by: Patrik Oldsberg --- .../src/lib/resolvers/CatalogAuthResolverContext.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts b/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts index 28bc066d10..1a1fdd7a36 100644 --- a/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts +++ b/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts @@ -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]));