Skip to content

Commit

Permalink
🛂 Prevent download config when (gchq#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Feb 13, 2022
1 parent cfe3a48 commit c1607cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/views/DownloadConfig.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<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;
},
yamlConfig() {
return JsYaml.dump(this.config);
},
allowViewConfig() {
return this.$store.getters.permissions.allowViewConfig;
},
},
};
Expand Down

0 comments on commit c1607cb

Please sign in to comment.