diff --git a/frontend/src/page/admin/users/index.js b/frontend/src/page/admin/users/index.js index 8ff91b8a65..b2c97ea039 100644 --- a/frontend/src/page/admin/users/index.js +++ b/frontend/src/page/admin/users/index.js @@ -1,21 +1,33 @@ -import React from 'react'; +import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import UsersList from './UsersList'; import AdminMenu from '../admin-menu'; import PageContent from '../../../component/common/PageContent/PageContent'; +import AccessContext from '../../../contexts/AccessContext'; +import ConditionallyRender from '../../../component/common/ConditionallyRender'; +import { ADMIN } from '../../../component/AccessProvider/permissions'; +import { Alert } from '@material-ui/lab'; -const render = ({history}) => ( -
- - - - -
-); +const UsersAdmin = ({history}) => { + const { hasAccess } = useContext(AccessContext); + + return ( +
+ + + } + elseShow={You need to be a root admin to access this section.} /> + + +
+ ); +} -render.propTypes = { +UsersAdmin.propTypes = { match: PropTypes.object.isRequired, history: PropTypes.object.isRequired, }; -export default render; +export default UsersAdmin;