diff options
Diffstat (limited to 'redfish-core')
-rw-r--r-- | redfish-core/lib/account_service.hpp | 8 | ||||
-rw-r--r-- | redfish-core/lib/roles.hpp | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index fa10c04dd3..8f28ea49f9 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -86,6 +86,10 @@ inline std::string getRoleIdFromPrivilege(std::string_view role) { return "Operator"; } + else if ((role == "") || (role == "priv-noaccess")) + { + return "NoAccess"; + } return ""; } inline std::string getPrivilegeFromRoleId(std::string_view role) @@ -102,6 +106,10 @@ inline std::string getPrivilegeFromRoleId(std::string_view role) { return "priv-operator"; } + else if (role == "NoAccess") + { + return "priv-noaccess"; + } return ""; } diff --git a/redfish-core/lib/roles.hpp b/redfish-core/lib/roles.hpp index 4256c7ec47..d2071a5cf1 100644 --- a/redfish-core/lib/roles.hpp +++ b/redfish-core/lib/roles.hpp @@ -36,6 +36,10 @@ inline std::string getRoleFromPrivileges(std::string_view priv) { return "Operator"; } + else if (priv == "priv-noaccess") + { + return "NoAccess"; + } return ""; } @@ -55,6 +59,10 @@ inline bool getAssignedPrivFromRole(std::string_view role, { privArray = {"Login", "ConfigureSelf"}; } + else if (role == "NoAccess") + { + privArray = nlohmann::json::array(); + } else { return false; |