From ed33514aee910302b82eb034dbfbcb8df39a514e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 24 Feb 2022 15:49:28 +0100 Subject: [PATCH] Voter adapted for use within vendee --- .../Security/Authorization/BudgetElementVoter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php index d815cc147..a396f78ba 100644 --- a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php +++ b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php @@ -18,6 +18,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface; use Chill\MainBundle\Security\Authorization\VoterHelperInterface; use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; +use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Person; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; @@ -47,7 +48,8 @@ class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierar $this->voter = $voterFactory ->generate(self::class) ->addCheckFor(AbstractElement::class, self::ROLES) - ->addCheckFor(null, [self::CREATE]) + ->addCheckFor(Person::class, [self::CREATE, self::SEE]) + ->addCheckFor(Household::class, [self::CREATE, self::SEE]) ->build(); }