mirror of https://github.com/Lissy93/dashy.git
🛂 Only authenticated users should be able to W2D
This commit is contained in:
parent
a88e899f53
commit
fb73f0e154
|
@ -24,6 +24,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
:click="writeToDisk"
|
:click="writeToDisk"
|
||||||
|
:disabled="!allowWriteToDisk"
|
||||||
v-tooltip="tooltip($t('interactive-editor.menu.save-disk-tooltip'))"
|
v-tooltip="tooltip($t('interactive-editor.menu.save-disk-tooltip'))"
|
||||||
>
|
>
|
||||||
{{ $t('interactive-editor.menu.save-disk-btn') }}
|
{{ $t('interactive-editor.menu.save-disk-btn') }}
|
||||||
|
@ -95,6 +96,7 @@ import EditPageInfo from '@/components/InteractiveEditor/EditPageInfo';
|
||||||
import EditAppConfig from '@/components/InteractiveEditor/EditAppConfig';
|
import EditAppConfig from '@/components/InteractiveEditor/EditAppConfig';
|
||||||
import { modalNames, localStorageKeys, serviceEndpoints } from '@/utils/defaults';
|
import { modalNames, localStorageKeys, serviceEndpoints } from '@/utils/defaults';
|
||||||
import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler';
|
import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler';
|
||||||
|
import { isUserAdmin } from '@/utils/Auth';
|
||||||
|
|
||||||
import SaveLocallyIcon from '@/assets/interface-icons/interactive-editor-save-locally.svg';
|
import SaveLocallyIcon from '@/assets/interface-icons/interactive-editor-save-locally.svg';
|
||||||
import SaveToDiskIcon from '@/assets/interface-icons/interactive-editor-save-disk.svg';
|
import SaveToDiskIcon from '@/assets/interface-icons/interactive-editor-save-disk.svg';
|
||||||
|
@ -124,6 +126,10 @@ export default {
|
||||||
config() {
|
config() {
|
||||||
return this.$store.state.config;
|
return this.$store.state.config;
|
||||||
},
|
},
|
||||||
|
allowWriteToDisk() {
|
||||||
|
const { appConfig } = this.config;
|
||||||
|
return appConfig.allowConfigEdit !== false && isUserAdmin();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue