From a10d48642fa4ad8908ba4bc7e58be5248dfc5f09 Mon Sep 17 00:00:00 2001 From: Tchama Date: Wed, 23 Jan 2019 09:11:53 +0100 Subject: [PATCH] wip.. corrections --- Resources/views/Event/listByPerson.html.twig | 2 +- Security/Authorization/EventVoter.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Resources/views/Event/listByPerson.html.twig b/Resources/views/Event/listByPerson.html.twig index cc99cff4f..f0337b300 100644 --- a/Resources/views/Event/listByPerson.html.twig +++ b/Resources/views/Event/listByPerson.html.twig @@ -50,7 +50,6 @@ diff --git a/Security/Authorization/EventVoter.php b/Security/Authorization/EventVoter.php index 77548f1a5..f3ef499f0 100644 --- a/Security/Authorization/EventVoter.php +++ b/Security/Authorization/EventVoter.php @@ -9,6 +9,7 @@ use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; use Chill\EventBundle\Entity\Event; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Entity\User; +use Chill\PersonBundle\Security\Authorization\PersonVoter; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; use Psr\Log\LoggerInterface; @@ -86,11 +87,11 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter } if ($subject instanceof Event) { - if ($subject->getPerson() === null) { + if ($subject->getId() === null) { throw new \LogicException("You should associate a person with event " . "in order to check autorizations"); } - $person = $subject->getPerson(); + $person = $subject->getId(); // liaison event --> person } elseif ($subject instanceof Person) { $person = $subject;