From 1f6805482bbfb400978dfbba3458b996250994d7 Mon Sep 17 00:00:00 2001 From: LakshikaAthapaththu Date: Wed, 9 Aug 2023 10:27:09 +0530 Subject: [PATCH] Call deleteGroupWithID from deleteGroup function --- .../scim2/common/impl/SCIMUserManager.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java index 2f4865f34..eb2731278 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java @@ -2780,8 +2780,10 @@ public void deleteGroup(String groupId) throws NotFoundException, CharonExceptio SCIMCommonUtils.setThreadLocalIsManagedThroughSCIMEP(true); // Get group name by id. - SCIMGroupHandler groupHandler = new SCIMGroupHandler(carbonUM.getTenantId()); - String groupName = groupHandler.getGroupName(groupId); +// SCIMGroupHandler groupHandler = new SCIMGroupHandler(carbonUM.getTenantId()); +// String groupName = groupHandler.getGroupName(groupId); + + String groupName = carbonUM.getGroupNameByGroupId(groupId); if (groupName != null) { String userStoreDomainFromSP = null; @@ -2805,7 +2807,8 @@ public void deleteGroup(String groupId) throws NotFoundException, CharonExceptio } //delete group in carbon UM - carbonUM.deleteRole(groupName); +// carbonUM.deleteRole(groupName); + carbonUM.deleteGroupWithID(groupId); carbonUM.removeGroupRoleMappingByGroupName(groupName); //we do not update Identity_SCIM DB here since it is updated in SCIMUserOperationListener's methods. @@ -2821,9 +2824,10 @@ public void deleteGroup(String groupId) throws NotFoundException, CharonExceptio } } catch (UserStoreException e) { throw resolveError(e, "Error occurred while deleting group " + groupId); - } catch (IdentitySCIMException e) { - throw new CharonException("Error occurred while deleting group " + groupId, e); } +// catch (IdentitySCIMException e) { +// throw new CharonException("Error occurred while deleting group " + groupId, e); +// } }