diff --git a/src/views/IOC/IOCListView.js b/src/views/IOC/IOCListView.js index 4e0e8ba3ded1898935ca729e554f99fcbd0521be..7d66b43830e24b99ac77f871b5ef458edd2dbae9 100644 --- a/src/views/IOC/IOCListView.js +++ b/src/views/IOC/IOCListView.js @@ -8,6 +8,7 @@ import { useIOCSearch, userContext } from "../../api/SwaggerApi"; import { makeStyles } from '@material-ui/core/styles'; import { initRequestParams } from "../../components/common/Helper"; import { SearchBar } from "../../components/common/SearchBar/SearchBar"; +import AccessControl from '../../components/auth/AccessControl'; const useStyles = makeStyles((theme) => ({ root: { @@ -86,12 +87,15 @@ export function IOCListView() { <Paper className={classes.root}> <Grid container spacing={1}> <Grid item xs={12} md={12}> - <Box display="flex" justifyContent="end" p={2} m={1}> - <FormControlLabel className={classes.formControl} - control={<Switch checked={ownOnly} onChange={handleChangeOwn} />} - label={<Typography variant="h5">My IOCs</Typography>} - /> - </Box> + <AccessControl allowedRoles={["DeploymentToolAdmin", "DeploymentToolIntegrator"]} + renderNoAccess={() => <></>} > + <Box display="flex" justifyContent="end" p={2} m={1}> + <FormControlLabel className={classes.formControl} + control={<Switch checked={ownOnly} onChange={handleChangeOwn} />} + label={<Typography variant="h5">My IOCs</Typography>} + /> + </Box> + </AccessControl> </Grid> <Grid item xs={12} md={12}> {content}