Skip to content

Commit

Permalink
Remove user role checks from navigation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ashanhr committed Oct 14, 2024
1 parent b2233e1 commit ffc6bde
Showing 1 changed file with 30 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Box from '@mui/material/Box';
import List from '@mui/material/List';
import LaunchIcon from '@mui/icons-material/Launch';
import { FormattedMessage, useIntl } from 'react-intl';
import AuthManager, { isRestricted } from 'AppData/AuthManager';
import { isRestricted } from 'AppData/AuthManager';
import { usePublisherSettings } from 'AppComponents/Shared/AppContext';
import Divider from '@mui/material/Divider';

Expand Down Expand Up @@ -58,9 +58,6 @@ const StyledBox = styled(Box)((
* @returns
*/
function GlobalNavLinks(props) {
const publisherUser = !AuthManager.isNotPublisher();
const readOnlyUser = AuthManager.isReadOnlyUser();
const adminUser = AuthManager.isAdminUser();

const { selected } = props;
const theme = useTheme();
Expand Down Expand Up @@ -119,41 +116,35 @@ function GlobalNavLinks(props) {
defaultMessage='Services'
/>
</GlobalNavLink>
{ (readOnlyUser || publisherUser)
&& (
<GlobalNavLink
to='/api-products'
type='api-product'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.api.products',
defaultMessage: 'API Products',
})}
active={selected === 'api-products'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.api.products'
defaultMessage='API Products'
/>
</GlobalNavLink>
)}
{(adminUser)
&& (
<GlobalNavLink
id='scope'
to='/scopes'
type='scopes'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.scopes',
defaultMessage: 'Scopes',
})}
active={selected === 'scopes'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.scopes'
defaultMessage='Scopes'
/>
</GlobalNavLink>
)}
<GlobalNavLink
to='/api-products'
type='api-product'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.api.products',
defaultMessage: 'API Products',
})}
active={selected === 'api-products'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.api.products'
defaultMessage='API Products'
/>
</GlobalNavLink>
<GlobalNavLink
id='scope'
to='/scopes'
type='scopes'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.scopes',
defaultMessage: 'Scopes',
})}
active={selected === 'scopes'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.scopes'
defaultMessage='Scopes'
/>
</GlobalNavLink>
<GlobalNavLink
id='policies'
to='/policies'
Expand Down

0 comments on commit ffc6bde

Please sign in to comment.