mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
add ACTIVITY_SEE_DETAILS role
This new role allow to see the details (remark + reasons) in the timeline.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Chill\ActivityBundle\Security\Authorization;
|
||||
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Security\ProvideRoleInterface;
|
||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ use Chill\MainBundle\Entity\Center;
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterface
|
||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
const STATS = 'CHILL_ACTIVITY_STATS';
|
||||
const LISTS = 'CHILL_ACTIVITY_LIST';
|
||||
@@ -74,4 +74,8 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterf
|
||||
return $this->getSupportedAttributes();
|
||||
}
|
||||
|
||||
public function getRolesWithHierarchy()
|
||||
{
|
||||
return [ 'Activity' => $this->getRoles() ];
|
||||
}
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
{
|
||||
const CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||
const SEE = 'CHILL_ACTIVITY_SEE';
|
||||
const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
||||
const UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
||||
const DELETE = 'CHILL_ACTIVITY_DELETE';
|
||||
|
||||
@@ -48,7 +49,8 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
|
||||
protected function getSupportedAttributes()
|
||||
{
|
||||
return array(self::CREATE, self::SEE, self::UPDATE, self::DELETE);
|
||||
return array(self::CREATE, self::SEE, self::UPDATE, self::DELETE,
|
||||
self::SEE_DETAILS);
|
||||
}
|
||||
|
||||
protected function getSupportedClasses()
|
||||
|
Reference in New Issue
Block a user