🛂 Only authenticated users should be able to W2D

This commit is contained in:
Alicia Sykes 2021-11-10 21:43:18 +00:00
parent a88e899f53
commit fb73f0e154
1 changed files with 6 additions and 0 deletions

View File

@ -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 {