sa: Fix SA issues.

This commit is contained in:
Pol Dellaiera
2021-11-23 12:49:20 +01:00
parent ba9e5d10b5
commit 9c167df78a
5 changed files with 8 additions and 22 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Chill\PersonBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
@@ -68,9 +70,8 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRole
}
if ($subject instanceof AccompanyingPeriod) {
if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) {
if (\in_array($attribute, [self::EDIT, self::DELETE])) {
if (\in_array($attribute, [self::EDIT, self::DELETE], true)) {
return false;
}
}