fixes on tests

This commit is contained in:
2021-12-08 10:56:39 +00:00
parent 56dd825f39
commit fa5001265f
26 changed files with 146 additions and 136 deletions

View File

@@ -19,7 +19,6 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Templating\EngineInterface as TemplatingEngine;
use function count;
@@ -145,7 +144,7 @@ class EventSearch extends AbstractSearch
{
// add security clauses
$reachableCenters = $this->helper
->getReachableCenters($this->user, new Role('CHILL_EVENT_SEE'));
->getReachableCenters($this->user, 'CHILL_EVENT_SEE');
if (count($reachableCenters) === 0) {
// add a clause to block all events
@@ -158,7 +157,7 @@ class EventSearch extends AbstractSearch
foreach ($reachableCenters as $center) {
$circles = $this->helper->getReachableScopes(
$this->user,
new Role('CHILL_EVENT_SEE'),
'CHILL_EVENT_SEE',
$center
);
$where = $qb->expr()->andX(

View File

@@ -23,7 +23,6 @@ use Doctrine\ORM\Mapping\ClassMetadata;
use LogicException;
use RuntimeException;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use function count;
/**
@@ -188,7 +187,7 @@ class TimelineEventProvider implements TimelineProviderInterface
ClassMetadata $metadataPerson,
Person $person
) {
$role = new Role('CHILL_EVENT_SEE');
$role = 'CHILL_EVENT_SEE';
$reachableCenters = $this->helper->getReachableCenters($this->user, $role);
$associationMapping = $metadataParticipation->getAssociationMapping('person');