Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:passport_control: Only authenticated users should be able to W2D

Alicia Sykesfb73f0e15498
diff --git a/src/components/InteractiveEditor/EditModeSaveMenu.vue b/src/components/InteractiveEditor/EditModeSaveMenu.vue
index 3e1b7aa7..4ba1c716 100644
--- a/src/components/InteractiveEditor/EditModeSaveMenu.vue
+++ b/src/components/InteractiveEditor/EditModeSaveMenu.vue
@@ -24,6 +24,7 @@
</Button>
<Button
:click="writeToDisk"
+ :disabled="!allowWriteToDisk"
v-tooltip="tooltip($t('interactive-editor.menu.save-disk-tooltip'))"
>
{{ $t('interactive-editor.menu.save-disk-btn') }}
@@ -95,6 +96,7 @@ import EditPageInfo from '@/components/InteractiveEditor/EditPageInfo';
import EditAppConfig from '@/components/InteractiveEditor/EditAppConfig';
import { modalNames, localStorageKeys, serviceEndpoints } from '@/utils/defaults';
import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler';
+import { isUserAdmin } from '@/utils/Auth';
import SaveLocallyIcon from '@/assets/interface-icons/interactive-editor-save-locally.svg';
import SaveToDiskIcon from '@/assets/interface-icons/interactive-editor-save-disk.svg';
@@ -124,6 +126,10 @@ export default {
config() {
return this.$store.state.config;
},
+ allowWriteToDisk() {
+ const { appConfig } = this.config;
+ return appConfig.allowConfigEdit !== false && isUserAdmin();
+ },
},
data() {
return {