diff --git a/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx b/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx index 21f26cbc1..4d7bdd502 100644 --- a/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx +++ b/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx @@ -1,12 +1,15 @@ +import { getAssignableRoles } from "@probo/helpers"; import { useTranslate } from "@probo/i18n"; import { Tbody, Td, Th, Thead, Tr } from "@probo/ui"; import type { ComponentProps } from "react"; +import { use } from "react"; import { ConnectionHandler, graphql, usePaginationFragment } from "react-relay"; import type { PeopleListFragment$key } from "#/__generated__/iam/PeopleListFragment.graphql"; import type { PeopleListFragment_RefetchQuery } from "#/__generated__/iam/PeopleListFragment_RefetchQuery.graphql"; import { type Order, SortableTable, SortableTh } from "#/components/SortableTable"; import { useOrganizationId } from "#/hooks/useOrganizationId"; +import { CurrentUser } from "#/providers/CurrentUser"; import { PeopleListItem } from "./PeopleListItem"; @@ -50,6 +53,8 @@ export function PeopleList(props: { const organizationId = useOrganizationId(); const { __ } = useTranslate(); + const { role } = use(CurrentUser); + const canManageRoles = getAssignableRoles(role).length > 0; const peoplePagination = usePaginationFragment< PeopleListFragment_RefetchQuery, @@ -85,7 +90,7 @@ export function PeopleList(props: { {__("Name")} {__("Status")} {__("Email")} - {__("Role")} + {canManageRoles && {__("Role")}} {__("Created on")} diff --git a/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx b/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx index 632851a90..a26aebe63 100644 --- a/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx +++ b/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx @@ -213,36 +213,38 @@ export function PeopleListItem(props: { {profile.source} - - - + + + )}