From 2ea92b70fca9098e666ef1947358a3df8019ad25 Mon Sep 17 00:00:00 2001 From: Shan Chathusanda Jayathilaka Date: Mon, 18 Mar 2024 17:11:30 +0530 Subject: [PATCH] Fix user deletion issue in the sub organizations --- .../carbon/identity/scim2/common/utils/SCIMCommonUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/SCIMCommonUtils.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/SCIMCommonUtils.java index 4dd1f403c..0db6f9028 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/SCIMCommonUtils.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/SCIMCommonUtils.java @@ -925,6 +925,9 @@ public static void updateSystemRoleV2MetaData(int tenantId) { */ public static String getLoggedInUserID() throws CharonException { + if (PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId() != null) { + return PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId(); + } try { String loggedInUserName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); String loggedInUserTenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();