diff options
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/util/permissions.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modern/src/common/util/permissions.js b/modern/src/common/util/permissions.js index 72ca0b08..27a9ba4f 100644 --- a/modern/src/common/util/permissions.js +++ b/modern/src/common/util/permissions.js @@ -2,6 +2,8 @@ import { useSelector } from 'react-redux'; export const useAdministrator = () => useSelector((state) => state.session.user?.administrator); +export const useManager = () => useSelector((state) => state.session.user?.administrator || (state.session.user?.userLimit || 0) > 0); + export const useReadonly = () => useSelector((state) => state.session.server?.readonly || state.session.user?.readonly); export const useDeviceReadonly = () => useSelector((state) => state.session.server?.readonly || state.session.user?.readonly |