From 3d0ae04abfe181b77bc6bdbc5e252f5ba775ea30 Mon Sep 17 00:00:00 2001 From: adriano Date: Thu, 13 Jan 2022 08:09:26 -0300 Subject: [PATCH] =?UTF-8?q?Cria=C3=A7=C3=A3o=20das=20rules=20no=20frontend?= =?UTF-8?q?=20para=20que=20somente=20o=20master=20possa=20visualizar=20os?= =?UTF-8?q?=20bot=C3=B5es=20de=20inser=C3=A7=C3=A3o=20e=20exclus=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/layout/MainListItems.js | 17 +++++++-- frontend/src/pages/Connections/index.js | 49 ++++++++++++++++-------- frontend/src/pages/Users/index.js | 51 ++++++++++++++++--------- frontend/src/rules.js | 7 +++- 4 files changed, 86 insertions(+), 38 deletions(-) diff --git a/frontend/src/layout/MainListItems.js b/frontend/src/layout/MainListItems.js index 3774242..682fce0 100644 --- a/frontend/src/layout/MainListItems.js +++ b/frontend/src/layout/MainListItems.js @@ -126,11 +126,20 @@ const MainListItems = (props) => { icon={} /> - } + + ( + } + /> + )} /> + + )} /> diff --git a/frontend/src/pages/Connections/index.js b/frontend/src/pages/Connections/index.js index 98bf43b..d1de3a3 100644 --- a/frontend/src/pages/Connections/index.js +++ b/frontend/src/pages/Connections/index.js @@ -329,13 +329,23 @@ const Connections = () => { {i18n.t("connections.title")} - + + + ( + + )} + /> + + + @@ -395,14 +405,23 @@ const Connections = () => { - { - handleOpenConfirmationModal("delete", whatsApp.id); - }} - > - - + + + ( + { + handleOpenConfirmationModal("delete", whatsApp.id); + }} + > + + + )} + /> + ))} diff --git a/frontend/src/pages/Users/index.js b/frontend/src/pages/Users/index.js index 783cd55..c934471 100644 --- a/frontend/src/pages/Users/index.js +++ b/frontend/src/pages/Users/index.js @@ -231,14 +231,24 @@ const Users = () => { ), }} /> + + + ( + + )} + /> + - + @@ -280,16 +290,23 @@ const Users = () => { > - - { - setConfirmModalOpen(true); - setDeletingUser(user); - }} - > - - + + + ( + { + setConfirmModalOpen(true); + setDeletingUser(user); + }} + > + + + )} + /> diff --git a/frontend/src/rules.js b/frontend/src/rules.js index 04eb6fd..9aaece3 100644 --- a/frontend/src/rules.js +++ b/frontend/src/rules.js @@ -16,7 +16,7 @@ const rules = { "dashboard-view:show", "queues-view:show", "user-view:show", - "settings-view:show", + //"settings-view:show", ], }, @@ -35,7 +35,10 @@ const rules = { "user-view:show", "settings-view:show", - //"remove-user-test" + "btn-add-user", + "icon-remove-user", + "btn-add-whatsapp", + "btn-remove-whatsapp", ], }, };