From 06dd04d074a79a082a51d37bb84a19d49b29fc05 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 15 May 2022 14:58:38 -0700 Subject: Add missing user details --- modern/src/common/util/permissions.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modern/src/common/util') 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 -- cgit v1.2.3