voters adjusted

This commit is contained in:
2021-11-19 11:29:29 +01:00
parent fc8a766c25
commit f145d6c921
4 changed files with 27 additions and 7 deletions

View File

@@ -76,6 +76,14 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov
return false;
}
if ($subject instanceof AccompanyingCourseDocument) {
if (AccompanyingPeriod::STEP_CLOSED === $subject->getCourse()->getStep()) {
if (\in_array($attribute, [self::UPDATE, self::CREATE, self::DELETE])) {
return false;
}
}
}
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
}