diff --git a/backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Mocks/Data/SingleRight/DelegationAccessCheckResponse/appid-510.json b/backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Mocks/Data/SingleRight/DelegationAccessCheckResponse/appid-510.json index ecc86ca01..b7005d53e 100644 --- a/backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Mocks/Data/SingleRight/DelegationAccessCheckResponse/appid-510.json +++ b/backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Mocks/Data/SingleRight/DelegationAccessCheckResponse/appid-510.json @@ -11,7 +11,7 @@ "status": "NotDelegable", "details": [ { - "code": "MissingSrrRightAccess", + "code": "AccessListValidationFail", "description": "The user have access through delegation(s) of the right to the recipient(s)", "parameters": { "roleRequirementsMatches": [ @@ -36,7 +36,7 @@ "status": "NotDelegable", "details": [ { - "code": "MissingSrrRightAccess", + "code": "AccessListValidationFail", "description": "The user have access through delegation(s) of the right to the recipient(s)", "parameters": { "roleRequirementsMatches": [ @@ -61,7 +61,7 @@ "status": "NotDelegable", "details": [ { - "code": "MissingSrrRightAccess", + "code": "AccessListValidationFail", "description": "The user have access through delegation(s) of the right to the recipient(s)", "parameters": { "roleRequirementsMatches": [ diff --git a/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceAlert.tsx b/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceAlert.tsx index e19d2de93..e8f8741de 100644 --- a/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceAlert.tsx +++ b/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceAlert.tsx @@ -52,7 +52,13 @@ export const ResourceAlert = ({ resource, error, rightReasons }: ResourceAlertPr ); } else if (rightReasons) { - if (rightReasons.every((reason) => reason === ErrorCode.MissingSrrRightAccess)) { + if ( + rightReasons.every( + (reason) => + reason === ErrorCode.MissingSrrRightAccess || + reason === ErrorCode.AccessListValidationFail, + ) + ) { headingText = t('delegation_modal.service_error.general_heading'); content = ( diff --git a/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceInfo.tsx b/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceInfo.tsx index 13e63b851..c48aa1a0b 100644 --- a/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceInfo.tsx +++ b/src/features/amUI/userRightsPage/DelegationModal/SingleRights/ResourceInfo.tsx @@ -123,7 +123,11 @@ export const ResourceInfo = ({ resource, toParty, onDelegate }: ResourceInfoProp const hasMissingSrrRightAccess = response.some( (result) => !hasMissingRoleAccess && - result.details?.some((detail) => detail.code === ErrorCode.MissingSrrRightAccess), + result.details?.some( + (detail) => + detail.code === ErrorCode.MissingSrrRightAccess || + detail.code === ErrorCode.AccessListValidationFail, + ), ); if (hasMissingRoleAccess) { diff --git a/src/resources/utils/errorCodeUtils.ts b/src/resources/utils/errorCodeUtils.ts index a2ed30b44..15ffef7e6 100644 --- a/src/resources/utils/errorCodeUtils.ts +++ b/src/resources/utils/errorCodeUtils.ts @@ -6,6 +6,7 @@ export enum ErrorCode { HTTPError = 'HTTPError', Unauthorized = 'Unauthorized', InsufficientAuthenticationLevel = 'InsufficientAuthenticationLevel', + AccessListValidationFail = 'AccessListValidationFail', Unknown = 'Unknown', } @@ -16,6 +17,7 @@ export const getErrorCodeTextKey = (errorCode: string | undefined): string | und case ErrorCode.MissingDelegationAccess: return 'single_rights.missing_delegation_access'; case ErrorCode.MissingSrrRightAccess: + case ErrorCode.AccessListValidationFail: return 'single_rights.missing_srr_right_access'; case ErrorCode.Unknown: return 'single_rights.unknown'; @@ -39,6 +41,7 @@ export const prioritizeErrors = (errors: string[]): string[] => { ErrorCode.MissingRoleAccess, ErrorCode.MissingDelegationAccess, ErrorCode.MissingSrrRightAccess, + ErrorCode.AccessListValidationFail, ErrorCode.Unknown, ];