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

@@ -15,7 +15,6 @@ use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\MainBundle\Entity\User;
use Chill\ActivityBundle\Entity\Activity;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Security;
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
@@ -115,7 +114,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
}
} elseif ($subject instanceof AccompanyingPeriod) {
if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) {
if (\in_array($attribute, [self::UPDATE, self::CREATE, self::DELETE])) {
if (\in_array($attribute, [self::UPDATE, self::CREATE, self::DELETE], true)) {
return false;
}
}