From 1032f8c3444120396ebbaa0ae9672974cabbcd61 Mon Sep 17 00:00:00 2001 From: Claudemir Todo Bom Date: Fri, 23 Aug 2024 15:15:58 -0300 Subject: [PATCH] Supervisor profile (pr #144 by @brunocgc) --- frontend/src/components/TicketsManagerTabs/index.js | 10 ++++++---- frontend/src/components/UserModal/index.js | 1 + frontend/src/rules.js | 10 ++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/TicketsManagerTabs/index.js b/frontend/src/components/TicketsManagerTabs/index.js index a8a1d4a1..d07863a0 100644 --- a/frontend/src/components/TicketsManagerTabs/index.js +++ b/frontend/src/components/TicketsManagerTabs/index.js @@ -116,11 +116,13 @@ const TicketsManagerTabs = () => { const [selectedUsers, setSelectedUsers] = useState([]); useEffect(() => { - if (user.profile.toUpperCase() === "ADMIN") { + if ( + user.profile.toUpperCase() === "ADMIN" || + user.profile.toUpperCase() === "SUPERVISOR" + ) { setShowAllTickets(true); } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [user]); useEffect(() => { if (tab === "search") { @@ -320,7 +322,7 @@ const TicketsManagerTabs = () => { - {profile === "admin" && ( + {(profile === "admin" || profile === "supervisor") && ( )} { required > Admin + Supervisor User diff --git a/frontend/src/rules.js b/frontend/src/rules.js index 17c669ff..76de0548 100644 --- a/frontend/src/rules.js +++ b/frontend/src/rules.js @@ -3,6 +3,16 @@ const rules = { static: [], }, + supervisor: { + static: [ + "dashboard:view", + "tickets-manager:showall", + "ticket-options:deleteTicket", + "contacts-page:deleteContact", + "contact-modal:editUserDefault", + ], + }, + admin: { static: [ //"dashboard:view",