mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
parent
7008284479
commit
4daa44ed57
@ -36,6 +36,7 @@ services:
|
||||
- "@chill.main.security.authorization.helper"
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
- { name: chill.role }
|
||||
|
||||
|
||||
chill.activity.timeline:
|
||||
|
@ -32,3 +32,7 @@ Reset form: Remise à zéro du formulaire
|
||||
'Success : activity updated!': Bravo ! L'activité a été mise à jour.
|
||||
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
|
||||
|
||||
# CONTROLLER
|
||||
CHILL_ACTIVITY_CREATE: Créer une activité
|
||||
CHILL_ACTIVITY_UPDATE: Modifier une activité
|
||||
CHILL_ACTIVITY_SEE: Voir une activité
|
@ -21,13 +21,14 @@ namespace Chill\ActivityBundle\Security\Authorization;
|
||||
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Security\ProvideRoleInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class ActivityVoter extends AbstractChillVoter
|
||||
class ActivityVoter extends AbstractChillVoter implements ProvideRoleInterface
|
||||
{
|
||||
const CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||
const SEE = 'CHILL_ACTIVITY_SEE';
|
||||
@ -63,4 +64,15 @@ class ActivityVoter extends AbstractChillVoter
|
||||
|
||||
return $this->helper->userHasAccess($user, $report, $attribute);
|
||||
}
|
||||
|
||||
public function getRoles()
|
||||
{
|
||||
return $this->getSupportedAttributes();
|
||||
}
|
||||
|
||||
public function getRolesWithoutScope()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user