Feature: Add a list export for evaluation, actions and household

This commit is contained in:
2023-01-26 14:22:30 +00:00
committed by Julien Fastré
parent 9ada19ef23
commit e54c2ca712
24 changed files with 1323 additions and 50 deletions

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Security\Authorization;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Security\Authorization\ChillVoterInterface;
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
@@ -23,7 +24,7 @@ use Symfony\Component\Security\Core\Security;
use UnexpectedValueException;
use function in_array;
class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface
class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface
{
public const EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT';
@@ -37,7 +38,9 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface
public const STATS = 'CHILL_PERSON_HOUSEHOLD_STATS';
private const ALL = [
self::EDIT, self::SEE,
self::SEE,
self::EDIT,
self::STATS,
];
private VoterHelperInterface $helper;
@@ -60,7 +63,7 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface
public function getRolesWithHierarchy(): array
{
return ['Person' => $this->getRoles()];
return ['Household' => $this->getRoles()];
}
public function getRolesWithoutScope(): array