From ca9498ba4a2b5c1ed05c92af8185484507ca7c35 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 12 Feb 2022 21:26:43 +0000 Subject: [PATCH] :passport_control: Remove start edditing button, if no permissions (#455) --- src/components/Settings/ConfigLauncher.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Settings/ConfigLauncher.vue b/src/components/Settings/ConfigLauncher.vue index 6ff46880..775fd4bb 100644 --- a/src/components/Settings/ConfigLauncher.vue +++ b/src/components/Settings/ConfigLauncher.vue @@ -7,7 +7,7 @@ v-tooltip="tooltip($t('settings.config-launcher-tooltip'))" /> + :class="(isEditMode || !isEditAllowed) ? 'disabled' : ''" /> @@ -91,8 +91,12 @@ export default { isEditMode() { return this.$store.state.editMode; }, + isEditAllowed() { + return this.$store.getters.permissions.allowViewConfig; + }, /* Tooltip text for Edit Mode button, to change depending on it in edit mode */ enterEditModeTooltip() { + if (!this.isEditAllowed) return 'Config editor not available'; return this.$t( `interactive-editor.menu.${this.isEditMode ? 'edit-mode-subtitle' : 'start-editing-tooltip'}`, @@ -126,7 +130,7 @@ export default { this.viewSwitcherOpen = false; }, startInteractiveEditor() { - if (!this.isEditMode) { + if (!this.isEditMode && this.isEditAllowed) { this.$store.commit(Keys.SET_EDIT_MODE, true); } },