From 4a275aeef906558894c8584ede19035bb4dc5bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnlaugur=20Gu=C3=B0mundsson?= Date: Fri, 20 Dec 2024 10:22:42 +0000 Subject: [PATCH] Utils func changes --- .../lib/delegations/utils/filterByScopeCustomScopeRule.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/auth-api-lib/src/lib/delegations/utils/filterByScopeCustomScopeRule.ts b/libs/auth-api-lib/src/lib/delegations/utils/filterByScopeCustomScopeRule.ts index c123a4f2ac67..87fbd1d7adff 100644 --- a/libs/auth-api-lib/src/lib/delegations/utils/filterByScopeCustomScopeRule.ts +++ b/libs/auth-api-lib/src/lib/delegations/utils/filterByScopeCustomScopeRule.ts @@ -3,6 +3,7 @@ import { ApiScopeInfo } from '../delegations-incoming.service' export default function filterByCustomScopeRule( scope: ApiScopeInfo, + filterOutForDelegationType: AuthDelegationType[], customScopeRules: { scopeName: string onlyForDelegationType: string[] @@ -14,7 +15,7 @@ export default function filterByCustomScopeRule( return true } - return foundCSR.onlyForDelegationType.includes( - AuthDelegationType.GeneralMandate, + return foundCSR.onlyForDelegationType.some((type) => + filterOutForDelegationType.includes(type as AuthDelegationType), ) }