From b4d1fb8b8e6e6cdb7be76a2d4fa0d2b9a84f3ba2 Mon Sep 17 00:00:00 2001
From: Vitalii Lysak <v.lysak@dunice.net>
Date: Wed, 10 Aug 2022 15:46:15 +0300
Subject: SILABMC-236: upd layput for ReadOnly role

---
 .../ServerPowerOperations/ServerPowerOperations.vue       | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue')

diff --git a/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue b/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue
index e848215f..f8a18a9e 100644
--- a/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue
+++ b/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue
@@ -72,6 +72,7 @@
             <b-button
               variant="primary"
               data-test-id="serverPowerOperations-button-powerOn"
+              :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
               @click="powerOn"
             >
               {{ $t('pageServerPowerOperations.powerOn') }}
@@ -88,6 +89,9 @@
                   name="reboot-option"
                   data-test-id="serverPowerOperations-radio-rebootOrderly"
                   value="orderly"
+                  :disabled="
+                    $store.getters['authentication/role'] === 'ReadOnly'
+                  "
                 >
                   {{ $t('pageServerPowerOperations.orderlyReboot') }}
                 </b-form-radio>
@@ -96,6 +100,9 @@
                   name="reboot-option"
                   data-test-id="serverPowerOperations-radio-rebootImmediate"
                   value="immediate"
+                  :disabled="
+                    $store.getters['authentication/role'] === 'ReadOnly'
+                  "
                 >
                   {{ $t('pageServerPowerOperations.immediateReboot') }}
                 </b-form-radio>
@@ -104,6 +111,7 @@
                 variant="primary"
                 type="submit"
                 data-test-id="serverPowerOperations-button-reboot"
+                :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
               >
                 {{ $t('pageServerPowerOperations.reboot') }}
               </b-button>
@@ -118,6 +126,9 @@
                   name="shutdown-option"
                   data-test-id="serverPowerOperations-radio-shutdownOrderly"
                   value="orderly"
+                  :disabled="
+                    $store.getters['authentication/role'] === 'ReadOnly'
+                  "
                 >
                   {{ $t('pageServerPowerOperations.orderlyShutdown') }}
                 </b-form-radio>
@@ -126,6 +137,9 @@
                   name="shutdown-option"
                   data-test-id="serverPowerOperations-radio-shutdownImmediate"
                   value="immediate"
+                  :disabled="
+                    $store.getters['authentication/role'] === 'ReadOnly'
+                  "
                 >
                   {{ $t('pageServerPowerOperations.immediateShutdown') }}
                 </b-form-radio>
@@ -134,6 +148,7 @@
                 variant="primary"
                 type="submit"
                 data-test-id="serverPowerOperations-button-shutDown"
+                :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
               >
                 {{ $t('pageServerPowerOperations.shutDown') }}
               </b-button>
-- 
cgit v1.2.3

