diff --git a/frontend/src/features/MainWindow/components/MapButtons/index.tsx b/frontend/src/features/MainWindow/components/MapButtons/index.tsx index 660e7c76b1..d15f291697 100644 --- a/frontend/src/features/MainWindow/components/MapButtons/index.tsx +++ b/frontend/src/features/MainWindow/components/MapButtons/index.tsx @@ -53,7 +53,7 @@ export function MapButtons() { {isFavoriteVesselsMapButtonDisplayed && } {isSuperUser && isFavoriteVesselsMapButtonDisplayed && } {isSuperUser && isAlertsMapButtonDisplayed && } - {import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true' && + {(isSuperUser || import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true') && isPriorNotificationMapButtonDisplayed && } {isSuperUser && isBeaconMalfunctionsMapButtonDisplayed && } diff --git a/frontend/src/features/SideWindow/Menu/index.tsx b/frontend/src/features/SideWindow/Menu/index.tsx index b4f7525a43..fb93e0b677 100644 --- a/frontend/src/features/SideWindow/Menu/index.tsx +++ b/frontend/src/features/SideWindow/Menu/index.tsx @@ -1,4 +1,5 @@ import { Icon, IconButton } from '@mtes-mct/monitor-ui' +import { useIsSuperUser } from 'auth/hooks/useIsSuperUser' import styled from 'styled-components' import { SideWindowMenuKey, SideWindowMenuLabel } from '../../../domain/entities/sideWindow/constants' @@ -10,6 +11,7 @@ export type MenuProps = Readonly<{ }> export function Menu({ selectedMenu }: MenuProps) { const dispatch = useMainAppDispatch() + const isSuperUser = useIsSuperUser() return ( @@ -32,7 +34,7 @@ export function Menu({ selectedMenu }: MenuProps) { selected={selectedMenu === SideWindowMenuKey.ALERT_LIST_AND_REPORTING_LIST} title={SideWindowMenuLabel.ALERT_LIST_AND_REPORTING_LIST} /> - {import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true' && ( + {(isSuperUser || import.meta.env.FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED === 'true') && (