summaryrefslogtreecommitdiffstats
path: root/user_channel/user_mgmt.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-11-19 17:45:35 -0800
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-11-26 16:41:57 +0000
commitdfad4863541f2315f02dd1c95cd7d4e8b688f697 (patch)
tree2eec6fc030218a92e9ff1279898109eeda500e65 /user_channel/user_mgmt.cpp
parent9cc0ea5f245b215e9eea41b9861f704c6b305671 (diff)
downloadphosphor-host-ipmid-dfad4863541f2315f02dd1c95cd7d4e8b688f697.tar.gz
phosphor-host-ipmid-dfad4863541f2315f02dd1c95cd7d4e8b688f697.zip
std::variant: Fix new instances of mapbox specific calls
Tested: Build and run through unit tests. Change-Id: I87f2d5441b2f029e1e96ee1b46c4c760b0d82aac Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'user_channel/user_mgmt.cpp')
-rw-r--r--user_channel/user_mgmt.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index e90bff6..7a11ff3 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -103,6 +103,8 @@ static std::array<std::string, (PRIVILEGE_OEM + 1)> ipmiPrivIndex = {
"priv-custom" // PRIVILEGE_OEM - 5
};
+namespace variant_ns = sdbusplus::message::variant_ns;
+
using namespace phosphor::logging;
using Json = nlohmann::json;
@@ -371,17 +373,17 @@ void userUpdatedSignalHandler(UserAccess& usrAccess,
std::string member = prop.first;
if (member == userPrivProperty)
{
- priv = prop.second.get<std::string>();
+ priv = variant_ns::get<std::string>(prop.second);
userEvent = UserUpdateEvent::userPrivUpdated;
}
else if (member == userGrpProperty)
{
- groups = prop.second.get<std::vector<std::string>>();
+ groups = variant_ns::get<std::vector<std::string>>(prop.second);
userEvent = UserUpdateEvent::userGrpUpdated;
}
else if (member == userEnabledProperty)
{
- enabled = prop.second.get<bool>();
+ enabled = variant_ns::get<bool>(prop.second);
userEvent = UserUpdateEvent::userStateUpdated;
}
// Process based on event type.
@@ -1134,11 +1136,13 @@ void UserAccess::getSystemPrivAndGroups()
auto key = t.first;
if (key == allPrivProperty)
{
- availablePrivileges = t.second.get<std::vector<std::string>>();
+ availablePrivileges =
+ variant_ns::get<std::vector<std::string>>(t.second);
}
else if (key == allGrpProperty)
{
- availableGroups = t.second.get<std::vector<std::string>>();
+ availableGroups =
+ variant_ns::get<std::vector<std::string>>(t.second);
}
}
// TODO: Implement Supported Privilege & Groups verification logic
@@ -1165,15 +1169,15 @@ void UserAccess::getUserProperties(const DbusUserObjProperties& properties,
std::string key = t.first;
if (key == userPrivProperty)
{
- usrPriv = t.second.get<std::string>();
+ usrPriv = variant_ns::get<std::string>(t.second);
}
else if (key == userGrpProperty)
{
- usrGrps = t.second.get<std::vector<std::string>>();
+ usrGrps = variant_ns::get<std::vector<std::string>>(t.second);
}
else if (key == userEnabledProperty)
{
- usrEnabled = t.second.get<bool>();
+ usrEnabled = variant_ns::get<bool>(t.second);
}
}
return;
OpenPOWER on IntegriCloud