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: Prevent download config when (#455)

Alicia Sykesc1607cb19bba
diff --git a/src/views/DownloadConfig.vue b/src/views/DownloadConfig.vue
index 0cc68943..e056daa0 100644
--- a/src/views/DownloadConfig.vue
+++ b/src/views/DownloadConfig.vue
@@ -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;
+ },
},
};