Make a few changes to privileges commit

1. Create char* overloads for the things that need it.
2. Fix up a couple errant moves
3. Use the gtest APIs for testing container membership, rather than sort
4. Move the index management to vector rather than map to avoid a lookup
5. Remove errant use of .at()
6. Move privilege comparison into the privilege class, in order to keep
the bitset implementation private.  This removes the requirment on the
forward declaration of PrivilegeProvider, and the use of friend class
7. Remove unimplemented override strcutures.  Feel free to add them
back once implemented
8. Make setSignlePrivilege return a code if the set failed
9. Remove the need for an extra construction of a blank privileges
object for things that require no privileges.

Tested by: updating unit tests with the appropriate APIs.  Relevant
unit tests pass

Change-Id: Ie9cde003b6c865979b4cac086379d0a3473896ce
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/redfish-core/include/node.hpp b/redfish-core/include/node.hpp
index 908d1a6..a33c8e0 100644
--- a/redfish-core/include/node.hpp
+++ b/redfish-core/include/node.hpp
@@ -29,9 +29,7 @@
 class Node {
  public:
   template <typename... Params>
-  Node(CrowApp& app, EntityPrivileges&& entityPrivileges,
-       std::string&& entityUrl, Params... params)
-      : entityPrivileges(std::move(entityPrivileges)) {
+  Node(CrowApp& app, std::string&& entityUrl, Params... params) {
     app.route_dynamic(entityUrl.c_str())
         .methods("GET"_method, "PATCH"_method, "POST"_method,
                  "DELETE"_method)([&](const crow::request& req,
@@ -86,6 +84,8 @@
     }
   }
 
+  OperationMap entityPrivileges;
+
  protected:
   // Node is designed to be an abstract class, so doGet is pure virtual
   virtual void doGet(crow::response& res, const crow::request& req,
@@ -118,8 +118,8 @@
     auto ctx =
         app.template get_context<crow::TokenAuthorization::Middleware>(req);
 
-    if (!entityPrivileges.isMethodAllowedForUser(req.method,
-                                                 ctx.session->username)) {
+    if (!isMethodAllowedForUser(req.method, entityPrivileges,
+                                ctx.session->username)) {
       res.code = static_cast<int>(HttpRespCode::METHOD_NOT_ALLOWED);
       res.end();
       return;
@@ -148,8 +148,6 @@
     }
     return;
   }
-
-  EntityPrivileges entityPrivileges;
 };
 
 }  // namespace redfish