mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
wip.. corrections
This commit is contained in:
parent
15ff92257c
commit
a10d48642f
@ -50,7 +50,6 @@
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
{#
|
||||
{% if is_granted('CHILL_EVENT_SEE_DETAILS', participation.event) %}
|
||||
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button black">
|
||||
{{ 'See'|trans }}
|
||||
@ -66,6 +65,7 @@
|
||||
{{ 'Edit'|trans }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{#
|
||||
#}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user