mmapGuard.dismiss();
file = GetFile(mem);
- return true;
+ return file != nullptr;
}
bool StorageBackendSerialized::StorageBackendSerializedImpl::init(const FB::File *f) {
return getDecisionItemMaybeNull(item, pimpl->getPolicySet<T>()->group()->LookupByKey(gid));
}
+template <typename T>
+bool StorageBackendSerialized::existsPolicyForGroup(gid_t gid) const {
+ return pimpl->getPolicySet<T>()->group()->LookupByKey(gid) != nullptr;
+}
+
#define T_INSTANTIATION(T) \
template ldp_xml_parser::DecisionItem StorageBackendSerialized::getDecisionItemContextMandatory(const ldp_xml_parser::MatchItem##T &item) const; \
template ldp_xml_parser::DecisionItem StorageBackendSerialized::getDecisionItemContextDefault(const ldp_xml_parser::MatchItem##T &item) const;
#define T_INSTANTIATION2(T) \
template ldp_xml_parser::DecisionItem StorageBackendSerialized::getDecisionItemUser(uid_t uid, const ldp_xml_parser::MatchItem##T &item) const; \
- template ldp_xml_parser::DecisionItem StorageBackendSerialized::getDecisionItemGroup(gid_t gid, const ldp_xml_parser::MatchItem##T &item) const;
+ template ldp_xml_parser::DecisionItem StorageBackendSerialized::getDecisionItemGroup(gid_t gid, const ldp_xml_parser::MatchItem##T &item) const; \
+ template bool StorageBackendSerialized::existsPolicyForGroup<ldp_xml_parser::MatchItem##T>(gid_t) const;
T_INSTANTIATION2(Own)
T_INSTANTIATION2(Send)
ldp_xml_parser::DecisionItem getDecisionItemUser(uid_t uid, const T &item) const;
template <typename T>
ldp_xml_parser::DecisionItem getDecisionItemGroup(gid_t gid, const T &item) const;
+
+ // This works with T set to MatchItemOwn, MatchItemSend or MatchItemReceive
+ // This is needed for filtering mapGroups. Check NaivePolicyChecker.
+ template <typename T>
+ bool existsPolicyForGroup(gid_t gid) const;
+
};
}