diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 0a38cf10b..d2b2d533c 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -42,3 +42,10 @@ The participations were created: Les participations ont été créées #search Event search: Recherche d'événements '%total% events match the search %pattern%' : '{0} Aucun événement ne correspond aux termes de recherche "%pattern%" | {1} Un événement a été trouvé par la recherche "%pattern%" | ]1,Inf] %total% événements correspondent aux termes de recherche "%pattern%".' + +CHILL_EVENT_UPDATE: Modifier un événement +CHILL_EVENT_CREATE: Créer un événement +CHILL_EVENT_PARTICIPATION_CREATE: Créer une participation à un événement +CHILL_EVENT_PARTICIPATION_UPDATE: Modifier une participation à un événement +CHILL_EVENT_SEE: Voir un événement +CHILL_EVENT_SEE_DETAILS: Voir les détails d'un événement diff --git a/Security/Authorization/EventVoter.php b/Security/Authorization/EventVoter.php index dc7a63971..8f74e649a 100644 --- a/Security/Authorization/EventVoter.php +++ b/Security/Authorization/EventVoter.php @@ -5,7 +5,7 @@ namespace Chill\EventBundle\Security\Authorization; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; -use Chill\MainBundle\Security\ProvideRoleInterface; +use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; use Chill\EventBundle\Entity\Event; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Entity\User; @@ -16,7 +16,7 @@ use Chill\MainBundle\Entity\User; * @author Julien Fastré * @author Champs Libres */ -class EventVoter extends AbstractChillVoter implements ProvideRoleInterface +class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { const SEE = 'CHILL_EVENT_SEE'; @@ -60,5 +60,11 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleInterface { return null; } + + + public function getRolesWithHierarchy() + { + return [ 'Event' => $this->getRoles() ]; + } } diff --git a/Security/Authorization/ParticipationVoter.php b/Security/Authorization/ParticipationVoter.php index e8ba27548..385796a71 100644 --- a/Security/Authorization/ParticipationVoter.php +++ b/Security/Authorization/ParticipationVoter.php @@ -19,7 +19,7 @@ namespace Chill\EventBundle\Security\Authorization; -use Chill\MainBundle\Security\ProvideRoleInterface; +use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\EventBundle\Entity\Participation; @@ -30,7 +30,7 @@ use Chill\MainBundle\Entity\User; * * @author Julien Fastré */ -class ParticipationVoter extends AbstractChillVoter implements ProvideRoleInterface +class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { /** * @@ -78,5 +78,10 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleInterf { return null; } + + public function getRolesWithHierarchy() + { + return [ 'Event' => $this->getRoles() ]; + } }