From d91ad6b505b41711c2d9edc0b4fae0dcff50800c Mon Sep 17 00:00:00 2001 From: ChanikaRuchini Date: Wed, 29 Nov 2023 16:32:13 +0530 Subject: [PATCH] Fix internal server errors while when updating an application role. --- .../carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java index 1f34f36b3..12da79976 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java @@ -769,6 +769,8 @@ private void doUpdatePermissions(RoleV2 oldRole, RoleV2 newRole) throws BadReque } catch (IdentityRoleManagementException e) { if (StringUtils.equals(RoleConstants.Error.INVALID_REQUEST.getCode(), e.getErrorCode())) { throw new BadRequestException(e.getMessage()); + } else if (RoleConstants.Error.INVALID_PERMISSION.getCode().equals(e.getErrorCode())) { + throw new BadRequestException(e.getMessage(), ResponseCodeConstants.INVALID_VALUE); } else if (StringUtils.equals(OPERATION_FORBIDDEN.getCode(), e.getErrorCode())) { throw new BadRequestException(e.getMessage()); }