diff options
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r-- | redfish-core/lib/network_protocol.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp index e4a4b56e8a..be842462a6 100644 --- a/redfish-core/lib/network_protocol.hpp +++ b/redfish-core/lib/network_protocol.hpp @@ -154,6 +154,12 @@ inline void afterNetworkPortRequest( inline void getNetworkData(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const crow::Request& req) { + if (req.session == nullptr) + { + messages::internalError(asyncResp->res); + return; + } + asyncResp->res.addHeader( boost::beast::http::field::link, "</redfish/v1/JsonSchemas/ManagerNetworkProtocol/NetworkProtocol.json>; rel=describedby"); @@ -216,7 +222,7 @@ inline void getNetworkData(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, }); Privileges effectiveUserPrivileges = - redfish::getUserPrivileges(req.userRole); + redfish::getUserPrivileges(*req.session); // /redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates is // something only ConfigureManager can access then only display when |