Skip to content

Commit

Permalink
Call deleteGroupWithID from deleteGroup function
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshiAthapaththu committed Aug 9, 2023
1 parent e96d5fd commit 1f68054
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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);
// }

}

Expand Down

0 comments on commit 1f68054

Please sign in to comment.