From 5a24dd115b864e9bbb30157dc318992adc46d3b3 Mon Sep 17 00:00:00 2001 From: Karel Hala Date: Wed, 23 Oct 2024 20:08:43 +0200 Subject: [PATCH] Fix user access location in settings icon (#2958) Co-authored-by: Filip Hlavac <50696716+fhlavac@users.noreply.github.com> --- src/components/Header/Tools.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Header/Tools.tsx b/src/components/Header/Tools.tsx index e954bf4bb..5d94c3102 100644 --- a/src/components/Header/Tools.tsx +++ b/src/components/Header/Tools.tsx @@ -75,8 +75,9 @@ const Tools = () => { const unreadNotifications = useAtomValue(unreadNotificationsAtom); const [isNotificationDrawerExpanded, toggleNotifications] = useAtom(notificationDrawerExpandedAtom); const intl = useIntl(); + const isOrgAdmin = user?.identity?.user?.is_org_admin; const settingsPath = isITLessEnv ? `/settings/my-user-access` : enableIntegrations ? `/settings/integrations` : '/settings/sources'; - const identityAndAccessManagmentPath = '/iam/user-access/overview'; + const identityAndAccessManagmentPath = isOrgAdmin ? '/iam/user-access/overview' : '/iam/my-user-access'; const betaSwitcherTitle = `${isPreview ? intl.formatMessage(messages.stopUsing) : intl.formatMessage(messages.use)} ${intl.formatMessage( messages.betaRelease )}`; @@ -113,7 +114,7 @@ const Tools = () => { items: [ { url: identityAndAccessManagmentPath, - title: 'User Access', + title: isOrgAdmin ? 'User Access' : 'My User Access', }, { url: '/iam/authentication-policy/authentication-factors',