From d9e602247e7e80884277dea7dc15453c1a7ec876 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 7 Sep 2022 11:09:03 +0200 Subject: [PATCH] fix errors with Role type --- src/Bundle/ChillMainBundle/Export/ExportManager.php | 4 ++-- .../GeographicalUnitStatAggregator.php | 2 +- .../ChillPersonBundle/Export/Export/ListPersonDuplicate.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index 9ba9bc1a8..788fae719 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -559,13 +559,13 @@ class ExportManager } foreach ($centers as $center) { - if ($this->authorizationChecker->isGranted($role->getRole(), $center) === false) { + if ($this->authorizationChecker->isGranted($role, $center) === false) { //debugging $this->logger->debug('user has no access to element', [ 'method' => __METHOD__, 'type' => get_class($element), 'center' => $center->getName(), - 'role' => $role->getRole(), + 'role' => $role, ]); ///// Bypasse les autorisations qui empĂȘche d'afficher les nouveaux exports diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index ed5d80ae8..18a1b3dea 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -64,7 +64,7 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface /** * @inheritDoc */ - public function addRole() + public function addRole(): ?string { return null; } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index 7f8688493..75d757f9e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -142,9 +142,9 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat return 'List duplicates'; } - public function requiredRole(): Role + public function requiredRole(): string { - return new Role(PersonVoter::DUPLICATE); + return PersonVoter::DUPLICATE; } public function validateForm($data, ExecutionContextInterface $context)