aboutsummaryrefslogtreecommitdiff
path: root/modern/src/DevicePage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/DevicePage.js')
-rw-r--r--modern/src/DevicePage.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/modern/src/DevicePage.js b/modern/src/DevicePage.js
index e4b853e7..560bbd20 100644
--- a/modern/src/DevicePage.js
+++ b/modern/src/DevicePage.js
@@ -13,6 +13,7 @@ import LinkField from './form/LinkField';
import { prefixString } from './common/stringUtils';
import { useTranslation } from './LocalizationProvider';
import useDeviceAttributes from './attributes/useDeviceAttributes';
+import { useAdministrator } from './common/permissions';
const useStyles = makeStyles(() => ({
details: {
@@ -24,6 +25,8 @@ const DevicePage = () => {
const classes = useStyles();
const t = useTranslation();
+ const admin = useAdministrator();
+
const deviceAttributes = useDeviceAttributes(t);
const [item, setItem] = useState();
@@ -105,10 +108,12 @@ const DevicePage = () => {
label={t('deviceCategory')}
variant="filled"
/>
- <FormControlLabel
- control={<Checkbox checked={item.disabled} onChange={(event) => setItem({ ...item, disabled: event.target.checked })} />}
- label={t('sharedDisabled')}
- />
+ {admin && (
+ <FormControlLabel
+ control={<Checkbox checked={item.disabled} onChange={(event) => setItem({ ...item, disabled: event.target.checked })} />}
+ label={t('sharedDisabled')}
+ />
+ )}
</AccordionDetails>
</Accordion>
<Accordion>