From 40a4451818d7abf476bc3bdc6a4ff0835da6da7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 22 Jun 2023 15:37:02 +0100 Subject: [PATCH] fix: add admin guard to groups (#4069) Adds an admin guard to groups: It is an admin feature and should be guarded on the UI the same way other admin features are. --- frontend/src/component/admin/groups/GroupsAdmin.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/admin/groups/GroupsAdmin.tsx b/frontend/src/component/admin/groups/GroupsAdmin.tsx index 8c4f06454d..9db4ba1730 100644 --- a/frontend/src/component/admin/groups/GroupsAdmin.tsx +++ b/frontend/src/component/admin/groups/GroupsAdmin.tsx @@ -1,9 +1,20 @@ +import { AdminAlert } from 'component/common/AdminAlert/AdminAlert'; import { GroupsList } from './GroupsList/GroupsList'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; +import { useContext } from 'react'; +import AccessContext from 'contexts/AccessContext'; +import { ADMIN } from '@server/types/permissions'; export const GroupsAdmin = () => { + const { hasAccess } = useContext(AccessContext); + return (
- + } + elseShow={} + />
); };