1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: all global event log requires admin

This commit is contained in:
Ivar Conradi Østhus 2021-05-04 22:06:47 +02:00
parent 3f5992902d
commit c0c69854e8
3 changed files with 24 additions and 4 deletions

View File

@ -45,6 +45,7 @@ const ProjectSelect = ({
<MenuItem <MenuItem
disabled={curentProject === ALL_PROJECTS} disabled={curentProject === ALL_PROJECTS}
data-target={ALL_PROJECTS.id} data-target={ALL_PROJECTS.id}
key={ALL_PROJECTS.id}
> >
{ALL_PROJECTS.name} {ALL_PROJECTS.name}
</MenuItem>, </MenuItem>,
@ -64,6 +65,7 @@ const ProjectSelect = ({
label={`${curentProject.name}`} label={`${curentProject.name}`}
callback={handleChangeProject} callback={handleChangeProject}
renderOptions={renderProjectOptions} renderOptions={renderProjectOptions}
className=""
/> />
</React.Fragment> </React.Fragment>
); );

View File

@ -20,7 +20,7 @@ const UsersAdmin = ({ history }) => {
show={<UsersList />} show={<UsersList />}
elseShow={ elseShow={
<Alert severity="error"> <Alert severity="error">
You need to be a root admin to access this section. You need instance admin to access this section.
</Alert> </Alert>
} }
/> />

View File

@ -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 HistoryComponent from '../../component/history/EventHistory';
import AccessContext from '../../contexts/AccessContext';
const render = () => <HistoryComponent />; const HistoryPage = ({ history }) => {
const { hasAccess } = useContext(AccessContext);
export default render; return (
<ConditionallyRender
condition={hasAccess(ADMIN)}
show={<HistoryComponent />}
elseShow={
<Alert severity="error">
You need instance admin to access this section.
</Alert>
}
/>
);
};
export default HistoryPage;