🛂 Prevent download config when (#455)

This commit is contained in:
Alicia Sykes 2022-02-13 14:10:23 +00:00
parent cfe3a48405
commit c1607cb19b
1 changed files with 9 additions and 1 deletions

View File

@ -1,12 +1,17 @@
<template>
<pre><code>{{ yamlConfig }}</code></pre>
<pre v-if="allowViewConfig"><code>{{ yamlConfig }}</code></pre>
<AccessError v-else />
</template>
<script>
import JsYaml from 'js-yaml';
import AccessError from '@/components/Configuration/AccessError';
export default {
name: 'DownloadConfig',
components: {
AccessError,
},
computed: {
config() {
return this.$store.state.config;
@ -14,6 +19,9 @@ export default {
yamlConfig() {
return JsYaml.dump(this.config);
},
allowViewConfig() {
return this.$store.getters.permissions.allowViewConfig;
},
},
};