diff --git a/openmetadata-ui/src/main/resources/ui/src/components/GlobalSetting/GlobalSettingLeftPanel.tsx b/openmetadata-ui/src/main/resources/ui/src/components/GlobalSetting/GlobalSettingLeftPanel.tsx index 1d6444475e9..a33d109e0a2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/GlobalSetting/GlobalSettingLeftPanel.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/GlobalSetting/GlobalSettingLeftPanel.tsx @@ -18,6 +18,7 @@ import React, { useMemo } from 'react'; import { useHistory, useParams } from 'react-router-dom'; import { GlobalSettingOptions } from '../../constants/GlobalSettings.constants'; import { TeamType } from '../../generated/entity/teams/team'; +import { useAuth } from '../../hooks/authHooks'; import { getGlobalSettingMenuItem, getGlobalSettingsMenuWithPermission, @@ -34,9 +35,11 @@ const GlobalSettingLeftPanel = () => { const { permissions } = usePermissionProvider(); + const { isAdminUser } = useAuth(); + const menuItems: ItemType[] = useMemo( () => - getGlobalSettingsMenuWithPermission(permissions).reduce( + getGlobalSettingsMenuWithPermission(permissions, isAdminUser).reduce( (acc: ItemType[], curr: MenuList) => { const menuItem = getGlobalSettingMenuItem( curr.category, diff --git a/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx index 5dee891ddcf..3289273d91b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx @@ -234,10 +234,7 @@ const GlobalSettingRouter = () => { { return [ { @@ -218,10 +219,7 @@ export const getGlobalSettingsMenuWithPermission = ( items: [ { label: 'Elasticsearch', - isProtected: userPermissions.hasViewPermissions( - ResourceEntity.ALL, - permissions - ), + isProtected: Boolean(isAdminUser), icon: ( ),