#include "anypolicyvalidator.h" #include "policy.h" AnyPolicyValidator::AnyPolicyValidator(const std::list>& policies) : Validator(policies) {} AnyPolicyValidator::~AnyPolicyValidator() {} Validator::ValidateResult AnyPolicyValidator::validate(const std::shared_ptr &actor) const { Validator::ValidateResult validate_result{false, ""}; for (const auto& policy : _validation_policies) { const auto result = policy->check(actor); if (result.satisfied) { validate_result.validate_output += result.commentary; validate_result.validate_output += "\n\n"; validate_result.success = true; break; } } return validate_result; }