add hierarchy in role + translations

This commit is contained in:
Julien Fastré 2017-04-19 22:28:14 +02:00
parent 6cdccb1553
commit 1bc93af148
2 changed files with 8 additions and 2 deletions

View File

@ -140,6 +140,7 @@ Opening the accompanying period: Ouverture d'une période d'accompagnement
CHILL_PERSON_SEE: Voir les personnes CHILL_PERSON_SEE: Voir les personnes
CHILL_PERSON_UPDATE: Modifier les personnes CHILL_PERSON_UPDATE: Modifier les personnes
CHILL_PERSON_CREATE: Ajouter des personnes CHILL_PERSON_CREATE: Ajouter des personnes
CHILL_PERSON_STATS: Statistiques sur les personnes
#period #period
Period closed!: Période clôturée! Period closed!: Période clôturée!

View File

@ -22,14 +22,14 @@ namespace Chill\PersonBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\ProvideRoleInterface; use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
/** /**
* *
* *
* @author Julien Fastré <julien.fastre@champs-libres.coop> * @author Julien Fastré <julien.fastre@champs-libres.coop>
*/ */
class PersonVoter extends AbstractChillVoter implements ProvideRoleInterface class PersonVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{ {
const CREATE = 'CHILL_PERSON_CREATE'; const CREATE = 'CHILL_PERSON_CREATE';
const UPDATE = 'CHILL_PERSON_UPDATE'; const UPDATE = 'CHILL_PERSON_UPDATE';
@ -86,5 +86,10 @@ class PersonVoter extends AbstractChillVoter implements ProvideRoleInterface
{ {
return $this->getSupportedAttributes(); return $this->getSupportedAttributes();
} }
public function getRolesWithHierarchy()
{
return [ 'Person' => $this->getRoles() ];
}
} }