From c0c69854e817857d015f9f36b1c84b41bcd1df17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 4 May 2021 22:06:47 +0200 Subject: [PATCH] fix: all global event log requires admin --- .../common/ProjectSelect/ProjectSelect.jsx | 2 ++ frontend/src/page/admin/users/index.js | 2 +- frontend/src/page/history/index.js | 24 ++++++++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx b/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx index 0d14e83630..d993d50bd4 100644 --- a/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx +++ b/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx @@ -45,6 +45,7 @@ const ProjectSelect = ({ {ALL_PROJECTS.name} , @@ -64,6 +65,7 @@ const ProjectSelect = ({ label={`${curentProject.name}`} callback={handleChangeProject} renderOptions={renderProjectOptions} + className="" /> ); diff --git a/frontend/src/page/admin/users/index.js b/frontend/src/page/admin/users/index.js index 7aca7ea94f..979e4b323f 100644 --- a/frontend/src/page/admin/users/index.js +++ b/frontend/src/page/admin/users/index.js @@ -20,7 +20,7 @@ const UsersAdmin = ({ history }) => { show={} elseShow={ - You need to be a root admin to access this section. + You need instance admin to access this section. } /> diff --git a/frontend/src/page/history/index.js b/frontend/src/page/history/index.js index 30e247616b..7ca21fa67a 100644 --- a/frontend/src/page/history/index.js +++ b/frontend/src/page/history/index.js @@ -1,6 +1,24 @@ -import React from 'react'; +import { Alert } from '@material-ui/lab'; +import React, { useContext } from 'react'; +import { ADMIN } from '../../component/AccessProvider/permissions'; +import ConditionallyRender from '../../component/common/ConditionallyRender'; import HistoryComponent from '../../component/history/EventHistory'; +import AccessContext from '../../contexts/AccessContext'; -const render = () => ; +const HistoryPage = ({ history }) => { + const { hasAccess } = useContext(AccessContext); -export default render; + return ( + } + elseShow={ + + You need instance admin to access this section. + + } + /> + ); +}; + +export default HistoryPage;