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()); }