Cache the user & channel acces in session
Instead of querying the user & channel access for every time
cache the same during session creation, and use it for
enforcements.
Tested-by:
Verified that RMCP+ session establishment works as expected
including INSUFFICIENT_PRIVILEGE error.
Change-Id: Ib5a05bd07cc9aabf2625a18090fd905d93489b24
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/session.hpp b/session.hpp
index bc48971..7b02221 100644
--- a/session.hpp
+++ b/session.hpp
@@ -12,6 +12,8 @@
#include <list>
#include <memory>
#include <string>
+#include <user_channel/channel_layer.hpp>
+#include <user_channel/user_layer.hpp>
#include <vector>
namespace session
@@ -272,6 +274,12 @@
*/
Privilege reqMaxPrivLevel;
+ /**
+ * @brief session's user & channel access details
+ */
+ ipmi::PrivAccess sessionUserPrivAccess{};
+ ipmi::ChannelAccess sessionChannelAccess{};
+
SequenceNumbers sequenceNums; // Session Sequence Numbers
State state = State::INACTIVE; // Session State
std::string userName{}; // User Name