30 lines
764 B
C++
30 lines
764 B
C++
#include "allpoliciesvalidator.h"
|
|
#include "policy.h"
|
|
|
|
AllPoliciesValidator::AllPoliciesValidator(const std::list<std::shared_ptr<Policy>>& policies) :
|
|
Validator(policies)
|
|
{}
|
|
|
|
AllPoliciesValidator::~AllPoliciesValidator()
|
|
{}
|
|
|
|
Validator::ValidateResult AllPoliciesValidator::validate(const std::shared_ptr<Actor> &actor) const
|
|
{
|
|
Validator::ValidateResult validate_result{true, ""};
|
|
|
|
for (const auto& policy : _validation_policies)
|
|
{
|
|
const auto result = policy->check(actor);
|
|
validate_result.validate_output += result.commentary;
|
|
validate_result.validate_output += "\n\n";
|
|
|
|
if (!result.satisfied)
|
|
{
|
|
validate_result.success = false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return validate_result;
|
|
}
|