mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 05:44:58 +00:00
add list for exports
This commit is contained in:
@@ -26,6 +26,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
use Chill\ReportBundle\Entity\Report;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,7 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte
|
||||
const CREATE = 'CHILL_REPORT_CREATE';
|
||||
const SEE = 'CHILL_REPORT_SEE';
|
||||
const UPDATE = 'CHILL_REPORT_UPDATE';
|
||||
const LISTS = 'CHILL_REPORT_LISTS';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -58,8 +60,8 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte
|
||||
return \in_array($attribute, [
|
||||
self::CREATE, self::UPDATE, self::SEE
|
||||
]);
|
||||
} else {
|
||||
return false;
|
||||
} elseif ($subject instanceof Center) {
|
||||
return $attribute === self::LISTS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,12 +77,12 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte
|
||||
|
||||
public function getRoles()
|
||||
{
|
||||
return [self::CREATE, self::UPDATE, self::SEE];
|
||||
return [self::CREATE, self::UPDATE, self::SEE, self::LISTS];
|
||||
}
|
||||
|
||||
public function getRolesWithoutScope()
|
||||
{
|
||||
return array();
|
||||
return array(self::LISTS);
|
||||
}
|
||||
|
||||
public function getRolesWithHierarchy()
|
||||
|
Reference in New Issue
Block a user