diff --git a/js/apps/admin-ui/src/user/UsersSection.tsx b/js/apps/admin-ui/src/user/UsersSection.tsx index e2bc5ca769..b3f67b0750 100644 --- a/js/apps/admin-ui/src/user/UsersSection.tsx +++ b/js/apps/admin-ui/src/user/UsersSection.tsx @@ -13,12 +13,18 @@ import { } from "../components/routable-tabs/RoutableTabs"; import useIsFeatureEnabled, { Feature } from "../utils/useIsFeatureEnabled"; import "./user-section.css"; +import { useAccess } from "../context/access/Access"; export default function UsersSection() { const { t } = useTranslation(); const { realm: realmName } = useRealm(); + const { hasAccess } = useAccess(); const isFeatureEnabled = useIsFeatureEnabled(); + const canViewPermissions = + isFeatureEnabled(Feature.AdminFineGrainedAuthz) && + hasAccess("manage-authorization", "manage-users", "manage-clients"); + const useTab = (tab: UserTab) => useRoutableTab( toUsers({ @@ -60,7 +66,7 @@ export default function UsersSection() { > - {isFeatureEnabled(Feature.AdminFineGrainedAuthz) && ( + {canViewPermissions && (