voter fixes

This commit is contained in:
2021-11-22 10:19:14 +01:00
parent 9e75c7e9b2
commit 2c74e268d3
5 changed files with 25 additions and 21 deletions

View File

@@ -112,11 +112,13 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
if (!$this->accessDecisionManager->decide($token, [AccompanyingPeriodVoter::SEE], $period)) {
return false;
}
}
}
if (AccompanyingPeriod::STEP_CLOSED === $subject->getCourse()->getStep()) {
if (\in_array($attribute, [self::UPDATE, self::CREATE_COURSE, self::DELETE])) {
return false;
}
if ($subject instanceof AccompanyingPeriod) {
if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) {
if (\in_array($attribute, [self::UPDATE, self::CREATE_COURSE, self::DELETE])) {
return false;
}
}
}