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:
parent
3f5992902d
commit
c0c69854e8
@ -45,6 +45,7 @@ const ProjectSelect = ({
|
||||
<MenuItem
|
||||
disabled={curentProject === ALL_PROJECTS}
|
||||
data-target={ALL_PROJECTS.id}
|
||||
key={ALL_PROJECTS.id}
|
||||
>
|
||||
{ALL_PROJECTS.name}
|
||||
</MenuItem>,
|
||||
@ -64,6 +65,7 @@ const ProjectSelect = ({
|
||||
label={`${curentProject.name}`}
|
||||
callback={handleChangeProject}
|
||||
renderOptions={renderProjectOptions}
|
||||
className=""
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
@ -20,7 +20,7 @@ const UsersAdmin = ({ history }) => {
|
||||
show={<UsersList />}
|
||||
elseShow={
|
||||
<Alert severity="error">
|
||||
You need to be a root admin to access this section.
|
||||
You need instance admin to access this section.
|
||||
</Alert>
|
||||
}
|
||||
/>
|
||||
|
@ -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 = () => <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;
|
||||
|
Loading…
Reference in New Issue
Block a user