mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 13:33:48 +00:00
wip.. corrections
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user