+ // initialize empty cache vector
+ mapped_privilege_cache[input_priv] = std::vector<std::string>();
+ LoggerD("Mapped privileges:");
+ auto push_elem = [](gpointer data, gpointer user_data) -> void {
+ if (data && user_data) {
+ std::vector<std::string>* mapped_vector =
+ static_cast<std::vector<std::string>*>(user_data);
+ char* char_data = static_cast<char*>(data);
+ mapped_vector->push_back(char_data);
+ LoggerD("mapped to: %s", char_data);
+ }
+ };
+ // fill the vector with data
+ g_list_foreach (mapped_glist, push_elem, &mapped_privilege_cache[input_priv]);
+ mapped_vector_ptr = &mapped_privilege_cache[input_priv];
+ } else {
+ // Retrieve from local cache
+ LoggerD("Mapped privileges already in cache");
+ mapped_vector_ptr = (std::vector<std::string>*) &(it->second);
+ }
+
+ if (!AccessControl::GetInstance().CheckAccess(*mapped_vector_ptr)){
+ for (const auto& mapped_priv : *mapped_vector_ptr) {