🛂 Adds access control checks in editor forms (#455)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
classes="dashy-modal edit-app-config"
|
||||
@closed="modalClosed"
|
||||
>
|
||||
<div class="edit-app-config-inner">
|
||||
<div class="edit-app-config-inner" v-if="allowViewConfig">
|
||||
<h3>{{ $t('interactive-editor.menu.edit-app-config-btn') }}</h3>
|
||||
<!-- Show caution message -->
|
||||
<div class="app-config-intro">
|
||||
@@ -35,6 +35,7 @@
|
||||
<!-- Save Button, lower -->
|
||||
<SaveCancelButtons :saveClick="saveToState" :cancelClick="cancelEditing" />
|
||||
</div>
|
||||
<AccessError v-else />
|
||||
</modal>
|
||||
</template>
|
||||
|
||||
@@ -43,6 +44,7 @@ import FormSchema from '@formschema/native';
|
||||
import DashySchema from '@/utils/ConfigSchema';
|
||||
import StoreKeys from '@/utils/StoreMutations';
|
||||
import { modalNames } from '@/utils/defaults';
|
||||
import AccessError from '@/components/Configuration/AccessError';
|
||||
import SaveCancelButtons from '@/components/InteractiveEditor/SaveCancelButtons';
|
||||
|
||||
export default {
|
||||
@@ -58,6 +60,7 @@ export default {
|
||||
components: {
|
||||
FormSchema,
|
||||
SaveCancelButtons,
|
||||
AccessError,
|
||||
},
|
||||
mounted() {
|
||||
this.formData = this.appConfig;
|
||||
@@ -66,6 +69,9 @@ export default {
|
||||
appConfig() {
|
||||
return this.$store.getters.appConfig;
|
||||
},
|
||||
allowViewConfig() {
|
||||
return this.$store.getters.permissions.allowViewConfig;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/* When form submitteed, update VueX store with new appConfig, and close modal */
|
||||
|
||||
Reference in New Issue
Block a user