Skip to content

Commit

Permalink
Fix orgaization ID set as SUPER org issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sadilchamishka committed Oct 27, 2023
1 parent d1d4280 commit 34df007
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.SUPER_ORG_ID;
import static org.wso2.carbon.identity.organization.management.service.util.Utils.buildURIForBody;
import static org.wso2.carbon.identity.organization.management.service.util.Utils.getOrganizationId;
import static org.wso2.carbon.identity.organization.management.service.util.Utils.getTenantDomain;
import static org.wso2.carbon.identity.rest.api.user.organization.v1.Constants.ASC_SORT_ORDER;
import static org.wso2.carbon.identity.rest.api.user.organization.v1.Constants.DESC_SORT_ORDER;
import static org.wso2.carbon.identity.rest.api.user.organization.v1.Constants.ORGANIZATIONS_ME_ENDPOINT;
Expand Down Expand Up @@ -103,10 +104,10 @@ public List<BasicOrganizationObject> getUserOrganizationHierarchyUptoResidentOrg

String userId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId();
String accessedOrgId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getOrganizationId();
if (StringUtils.isBlank(accessedOrgId)) {
accessedOrgId = SUPER_ORG_ID;
}
try {
if (StringUtils.isBlank(accessedOrgId)) {
accessedOrgId = getOrganizationManagementService().resolveOrganizationId(getTenantDomain());;
}
List<BasicOrganizationObject> rootDescendantsOrganizationResponseList = new ArrayList<>();
List<BasicOrganization> basicOrganizationList = getOrganizationUserResidentResolverService()
.getHierarchyUptoResidentOrganization(userId, accessedOrgId);
Expand Down

0 comments on commit 34df007

Please sign in to comment.