summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorAravinth S <aravinths@ami.com>2025-08-20 12:38:17 +0300
committerKiran Kumar Ballapalli <kirankumarb@ami.com>2025-09-18 16:18:26 +0300
commit99fe228eef84d018125712187e04b24a328d292b (patch)
tree1c885447c938702accf56e060f24124956ef7008 /src/store
parent399ade7239bebe83be8305bdce406043c2fef3cd (diff)
downloadwebui-vue-master.tar.xz
Add privilege check to power operation buttonHEADmaster
Disables power operation buttons for users with "Read-only" privileges. This change ensures that only "Operator" and administrative users can perform power operations, preventing unauthorized actions and enhancing system security. Change-Id: I515ede092cef3c82a110d9534d9f8d3d6afc3135 Signed-off-by: Aravinth S <aravinths@ami.com>
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/GlobalStore.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js
index ed3e381a8..e42367b34 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -7,6 +7,12 @@ const HOST_STATE = {
diagnosticMode: 'xyz.openbmc_project.State.Host.HostState.DiagnosticMode',
};
+const privilegesId = {
+ admin: 'Administrator',
+ operator: 'Operator',
+ readOnly: 'ReadOnly',
+};
+
const serverStateMapper = (hostState) => {
switch (hostState) {
case HOST_STATE.on:
@@ -137,5 +143,6 @@ const GlobalStore = {
},
},
};
+export { GlobalStore, serverStateMapper, privilegesId };
export default GlobalStore;