From bd8ff39ff366df76fc4a4fdbffe58be54c7f2dba Mon Sep 17 00:00:00 2001 From: sadilchamishka Date: Wed, 1 Nov 2023 22:57:25 +0530 Subject: [PATCH 1/3] Get user resident organization from carbon context --- .../listener/SharingOrganizationCreatorUserEventHandler.java | 3 ++- pom.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java b/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java index 9a8b30b07..fc2565129 100644 --- a/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java +++ b/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java @@ -63,7 +63,8 @@ public void handleEvent(Event event) throws IdentityEventException { } String associatedUserId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId(); - String associatedOrgId = (String) IdentityUtil.threadLocalProperties.get().get("USER_RESIDENT_ORG"); + String associatedOrgId = PrivilegedCarbonContext.getThreadLocalCarbonContext() + .getUserResidentOrganizationId(); if (StringUtils.isEmpty(associatedOrgId)) { associatedOrgId = getOrganizationManager().resolveOrganizationId(Utils.getTenantDomain()); } diff --git a/pom.xml b/pom.xml index 7ace0e062..c76adea86 100644 --- a/pom.xml +++ b/pom.xml @@ -472,7 +472,7 @@ - 4.9.16 + 4.9.17-SNAPSHOT [4.7.0, 5.0.0) 4.6.0 From 63f4d3f92fa318edf2c847bdceddbc8e9b6fe9f6 Mon Sep 17 00:00:00 2001 From: sadilchamishka Date: Fri, 3 Nov 2023 19:16:42 +0530 Subject: [PATCH 2/3] Bump kernel version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c76adea86..8506204bc 100644 --- a/pom.xml +++ b/pom.xml @@ -472,7 +472,7 @@ - 4.9.17-SNAPSHOT + 4.9.17 [4.7.0, 5.0.0) 4.6.0 From 7a8d60b6e0ebf98b0769f01e2e078742a4aaad2c Mon Sep 17 00:00:00 2001 From: sadilchamishka Date: Fri, 3 Nov 2023 19:23:05 +0530 Subject: [PATCH 3/3] Fix checkstyle issues --- .../listener/SharingOrganizationCreatorUserEventHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java b/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java index fc2565129..f146010f0 100644 --- a/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java +++ b/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java @@ -20,7 +20,6 @@ import org.apache.commons.lang.StringUtils; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.identity.core.util.IdentityUtil; import org.wso2.carbon.identity.event.IdentityEventException; import org.wso2.carbon.identity.event.event.Event; import org.wso2.carbon.identity.event.handler.AbstractEventHandler;