diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-05 15:56:39 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-05 15:56:39 +0300 |
commit | 86de3af082ba6c541d9a6cb10c4db0d14f6267e8 (patch) | |
tree | d68f6f7560b98cbd9451e035198778f7fbf1b340 /src/components/_sila/Global/TableToolbar.vue | |
parent | fec1602b12c66e7675f4020d544886871cf5f5c9 (diff) | |
download | webui-vue-86de3af082ba6c541d9a6cb10c4db0d14f6267e8.tar.xz |
add method for isNotAdmin
Diffstat (limited to 'src/components/_sila/Global/TableToolbar.vue')
-rw-r--r-- | src/components/_sila/Global/TableToolbar.vue | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/_sila/Global/TableToolbar.vue b/src/components/_sila/Global/TableToolbar.vue index 53d004cf..4f1dfe63 100644 --- a/src/components/_sila/Global/TableToolbar.vue +++ b/src/components/_sila/Global/TableToolbar.vue @@ -13,7 +13,7 @@ :data-test-id="`table-button-${action.value}Selected`" variant="primary" class="d-block" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="$emit('batch-action', action.value)" > {{ action.label }} @@ -57,6 +57,14 @@ export default { isToolbarActive: false, }; }, + computed: { + isNotAdmin() { + return ( + this.$store.getters['authentication/role'] === 'ReadOnly' || + this.$store.getters['authentication/role'] === 'Operator' + ); + }, + }, watch: { selectedItemsCount: function (selectedItemsCount) { if (selectedItemsCount > 0) { |