Skip to content

Commit

Permalink
Merge pull request wso2#6227 from kayathiri4/hide-user
Browse files Browse the repository at this point in the history
Hide Organization creator in the sub org's user list in old runtime
  • Loading branch information
kayathiri4 authored May 10, 2024
2 parents 0494717 + 2332207 commit 4e4606c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-boxes-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/console": patch
---

Hide Organization creator in the sub org's user list in old runtime
12 changes: 12 additions & 0 deletions features/admin.users.v1/pages/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { useDispatch, useSelector } from "react-redux";
import { RouteComponentProps } from "react-router";
import { Dispatch } from "redux";
import { Dropdown, DropdownItemProps, DropdownProps, Icon, PaginationProps, TabProps } from "semantic-ui-react";
import useAuthorization from "../../admin.authorization.v1/hooks/use-authorization";
import {
AdvancedSearchWithBasicFilters,
AppConstants,
Expand All @@ -64,6 +65,7 @@ import {
} from "../../admin.core.v1";
import { userstoresConfig } from "../../admin.extensions.v1";
import { FeatureGateConstants } from "../../admin.extensions.v1/components/feature-gate/constants/feature-gate";
import { SCIMConfigs } from "../../admin.extensions.v1/configs/scim";
import { useGetCurrentOrganizationType } from "../../admin.organizations.v1/hooks/use-get-organization-type";
import {
ConnectorPropertyInterface,
Expand Down Expand Up @@ -126,6 +128,7 @@ const UsersPage: FunctionComponent<UsersPageInterface> = (
const { t } = useTranslation();

const dispatch: Dispatch<any> = useDispatch();
const { legacyAuthzRuntime } = useAuthorization();

const saasFeatureStatus : FeatureStatus = useCheckFeatureStatus(
FeatureGateConstants.SAAS_FEATURES_IDENTIFIER);
Expand Down Expand Up @@ -496,6 +499,15 @@ const UsersPage: FunctionComponent<UsersPageInterface> = (
return resource;
});

if (legacyAuthzRuntime) {
clonedUserList.Resources = clonedUserList?.Resources?.filter((resource: UserBasicInterface) =>
!resource[SCIMConfigs?.scim?.enterpriseSchema]?.managedOrg);
}

if (clonedUserList.totalResults && clonedUserList.totalResults > 0) {
clonedUserList.totalResults = clonedUserList?.Resources?.length;
}

return moderateUsersList(clonedUserList, modifiedLimit, TEMP_RESOURCE_LIST_ITEM_LIMIT_OFFSET);
};

Expand Down

0 comments on commit 4e4606c

Please sign in to comment.