From bf488dc536896b86f768f33bc493fef525b5d0ff Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 18 Jul 2024 13:26:29 +0200 Subject: [PATCH] Apply menu permissions also to subitems --- frontend/src/layouts/dashboard/NavBar.vue | 34 +++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/layouts/dashboard/NavBar.vue b/frontend/src/layouts/dashboard/NavBar.vue index b8a951b26..a88c1603c 100644 --- a/frontend/src/layouts/dashboard/NavBar.vue +++ b/frontend/src/layouts/dashboard/NavBar.vue @@ -46,14 +46,15 @@ > - + @@ -176,7 +177,7 @@ const mainMenuItems = [ text: $gettext('Dashboard'), to: { name: 'Dashboard' }, exact: true, - icon: 'mdi-view-dashboard-outline' + icon: 'mdi-view-dashboard-outline', }, { text: $gettext('Domains'), @@ -245,7 +246,7 @@ const mainMenuItems = [ text: $gettext('Information'), roles: ['SuperAdmins'], to: { name: 'Information' }, - } + }, ] const userMenuItems = [ @@ -262,11 +263,11 @@ const userMenuItems = [ }, ] -if (isAuthenticated && authUser.value.role !== 'SimpleUsers') { +if (isAuthenticated.value && authUser.value.role !== 'SimpleUsers') { userMenuItems.unshift({ text: $gettext('Admin'), to: { name: 'Dashboard' }, - icon: 'mdi-view-dashboard-outline' + icon: 'mdi-view-dashboard-outline', }) } @@ -277,13 +278,13 @@ function getUserSettingsMenuItems() { result.push({ text: $gettext('Filters'), to: { name: 'AccountFilters' }, - icon: 'mdi-filter' + icon: 'mdi-filter', }) } result.push({ text: $gettext('Settings'), to: { name: 'AccountSettings' }, - icon: 'mdi-cog' + icon: 'mdi-cog', }) return result } @@ -318,7 +319,10 @@ onMounted(() => { }) }) } - if (authUser.value.role === 'SuperAdmins' && parametersStore.imapMigrationEnabled === null) { + if ( + authUser.value.role === 'SuperAdmins' && + parametersStore.imapMigrationEnabled === null + ) { parametersApi.getApplication('imap_migration').then((response) => { parametersStore.imapMigrationEnabled = response.data.params.enabled_imapmigration