Add dynamic AccountService Roles
Get roles on local user management privilege dropdown
from /redfish/v1/AccountService/Roles instead of hard-coded
values.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I00409b17fc1a2a49b880883749c0241e0aae283e
diff --git a/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue b/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue
index c08b39b..b9df58f 100644
--- a/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue
+++ b/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue
@@ -200,6 +200,7 @@
created() {
this.$store.dispatch('localUsers/getUsers');
this.$store.dispatch('localUsers/getAccountSettings');
+ this.$store.dispatch('localUsers/getAccountRoles');
},
methods: {
initModalUser(user) {
diff --git a/src/views/AccessControl/LocalUserManagement/ModalUser.vue b/src/views/AccessControl/LocalUserManagement/ModalUser.vue
index a9c0f6c..f4a66e7 100644
--- a/src/views/AccessControl/LocalUserManagement/ModalUser.vue
+++ b/src/views/AccessControl/LocalUserManagement/ModalUser.vue
@@ -225,7 +225,6 @@
},
data() {
return {
- privilegeTypes: ['Administrator', 'Operator', 'ReadOnly', 'NoAccess'],
originalUsername: '',
form: {
status: true,
@@ -246,6 +245,9 @@
},
manualUnlockPolicy() {
return !this.accountSettings.accountLockoutDuration;
+ },
+ privilegeTypes() {
+ return this.$store.getters['localUsers/accountRoles'];
}
},
watch: {