From 39520a8c49037d32860d0638b7325a08d2466168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= Date: Fri, 24 Nov 2023 11:59:34 +0100 Subject: [PATCH] Hide admin page link for non-admin users --- CHANGELOG.md | 1 + .../Navigation/UserMenuDropdown.vue | 9 ++++--- src/router/router-guards/routerGuardUtil.js | 6 ++--- src/store/index.js | 16 ------------ src/util/user.js | 10 ++++++++ src/views/Admin/AdminWrapper.vue | 6 ++--- src/views/Admin/components/AdminUsers.vue | 7 ++---- src/views/Item/ItemIntegrations.vue | 2 +- tests/unit/util/user.test.js | 25 +++++++++++++++++++ 9 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 src/util/user.js create mode 100644 tests/unit/util/user.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 265015b5f..b7583f361 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ All notable changes to this project will be documented in this file. The format based on the admin level of the current user. - Organization admins should now be allowed to edit own organizations including child departments and products. +- The link to the admin page is no longer visible to non-admin users. ### Security diff --git a/src/components/Navigation/UserMenuDropdown.vue b/src/components/Navigation/UserMenuDropdown.vue index 4e01f49c2..c62218fdc 100644 --- a/src/components/Navigation/UserMenuDropdown.vue +++ b/src/components/Navigation/UserMenuDropdown.vue @@ -47,7 +47,7 @@