remove usage of deprecated Role into Export

This commit is contained in:
Julien Fastré 2022-09-05 17:26:36 +02:00
parent c442529799
commit 75bdc335e5
125 changed files with 153 additions and 154 deletions

View File

@ -33,7 +33,7 @@ class BySocialActionAggregator implements AggregatorInterface
$this->actionRepository = $actionRepository;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class BySocialIssueAggregator implements AggregatorInterface
$this->issueRender = $issueRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
$this->thirdPartyRender = $thirdPartyRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class ByUserAggregator implements AggregatorInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -38,7 +38,7 @@ class DateAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class LocationTypeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class UserScopeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -39,9 +39,9 @@ class ActivityTypeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return new Role(ActivityStatsVoter::STATS);
return null;
}
public function alterQuery(QueryBuilder $qb, $data)

View File

@ -37,9 +37,9 @@ class ActivityUserAggregator implements AggregatorInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return new Role(ActivityStatsVoter::STATS);
return null;
}
public function alterQuery(QueryBuilder $qb, $data)

View File

@ -48,9 +48,9 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return new Role(ActivityStatsVoter::STATS);
return null;
}
public function alterQuery(QueryBuilder $qb, $data)

View File

@ -92,9 +92,9 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -92,9 +92,9 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -93,9 +93,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -92,9 +92,9 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -92,9 +92,9 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -97,9 +97,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers()

View File

@ -275,9 +275,9 @@ class ListActivity implements ListInterface, GroupedExportInterface
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::LISTS);
return ActivityStatsVoter::LISTS;
}
public function supportsModifiers()

View File

@ -127,9 +127,9 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
->setParameter(':centers', $centers);
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(ActivityStatsVoter::STATS);
return ActivityStatsVoter::STATS;
}
public function supportsModifiers()

View File

@ -30,7 +30,7 @@ class BySocialActionFilter implements FilterInterface
$this->actionRender = $actionRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class BySocialIssueFilter implements FilterInterface
$this->issueRender = $issueRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class ByUserFilter implements FilterInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class EmergencyFilter implements FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class LocationTypeFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -36,7 +36,7 @@ class SentReceivedFilter implements FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -29,7 +29,7 @@ class UserFilter implements FilterInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class UserScopeFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class ActivityDateFilter implements FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -42,9 +42,9 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
$this->activityTypeRepository = $activityTypeRepository;
}
public function addRole()
public function addRole(): ?string
{
return new Role(ActivityStatsVoter::STATS);
return null;
}
public function alterQuery(QueryBuilder $qb, $data)

View File

@ -44,9 +44,9 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
$this->activityReasonRepository = $activityReasonRepository;
}
public function addRole()
public function addRole(): ?string
{
return new Role(ActivityStatsVoter::STATS);
return null;
}
public function alterQuery(QueryBuilder $qb, $data)

View File

@ -52,7 +52,7 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class AgentAggregator implements AggregatorInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class CancelReasonAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class JobAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -29,7 +29,7 @@ final class LocationAggregator implements AggregatorInterface
$this->locationRepository = $locationRepository;
}
public function addRole(): ?Role
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class LocationTypeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -20,7 +20,7 @@ use Symfony\Component\Security\Core\Role\Role;
class MonthYearAggregator implements AggregatorInterface
{
public function addRole(): ?Role
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class ScopeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -103,10 +103,10 @@ class CountAppointments implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
// which role should we give here?
return new Role(PersonVoter::STATS);
return PersonVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -97,9 +97,9 @@ class StatAppointmentAvgDuration implements ExportInterface, GroupedExportInterf
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -97,9 +97,9 @@ class StatAppointmentSumDuration implements ExportInterface, GroupedExportInterf
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -29,7 +29,7 @@ class AgentFilter implements FilterInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class BetweenDatesFilter implements FilterInterface
{
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class JobFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class ScopeFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -139,10 +139,8 @@ interface ExportInterface extends ExportElementInterface
/**
* Return the required Role to execute the Export.
*
* @return \Symfony\Component\Security\Core\Role\Role
*/
public function requiredRole();
public function requiredRole(): string;
/**
* Inform which ModifiersInterface (i.e. AggregatorInterface, FilterInterface)

View File

@ -550,7 +550,7 @@ class ExportManager
if (null === $centers) {
$centers = $this->authorizationHelper->getReachableCenters(
$this->user,
$role->getRole(),
$role
);
}

View File

@ -26,9 +26,9 @@ interface ModifierInterface extends ExportElementInterface
* If null, will used the ExportInterface::requiredRole role from
* the current executing export.
*
* @return \Symfony\Component\Security\Core\Role\Role|null A role required to execute this ModifiersInterface
* @return string|null A role required to execute this ModifiersInterface
*/
public function addRole();
public function addRole(): ?string;
/**
* Alter the query initiated by the export, to add the required statements

View File

@ -32,7 +32,7 @@ class AdministrativeLocationAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ class ClosingMotiveAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -27,7 +27,7 @@ class ConfidentialAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class DurationAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -27,7 +27,7 @@ class EmergencyAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class EvaluationAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -27,7 +27,7 @@ class IntensityAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class JobAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -34,7 +34,7 @@ final class OriginAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class ReferrerAggregator implements AggregatorInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class ScopeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class SocialActionAggregator implements AggregatorInterface
$this->actionRepository = $actionRepository;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class SocialIssueAggregator implements AggregatorInterface
$this->issueRender = $issueRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -33,7 +33,7 @@ final class StepAggregator implements AggregatorInterface //, FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ class EvaluationTypeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class ChildrenNumberAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -37,7 +37,7 @@ class CompositionAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -29,7 +29,7 @@ final class AgeAggregator implements AggregatorInterface, ExportElementValidated
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -42,7 +42,7 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -28,7 +28,7 @@ final class GenderAggregator implements AggregatorInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -37,7 +37,7 @@ final class HouseholdPositionAggregator implements AggregatorInterface, ExportEl
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ final class MaritalStatusAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -41,7 +41,7 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ final class ActionTypeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ final class GoalAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class JobAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class ReferrerAggregator implements AggregatorInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ final class ResultAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ final class ScopeAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -98,9 +98,9 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -98,9 +98,9 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -17,6 +17,7 @@ use Chill\MainBundle\Export\GroupedExportInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;
@ -100,10 +101,9 @@ class CountHousehold implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
// TODO HouseholdVoter::STATS !??
return new Role(AccompanyingPeriodVoter::STATS);
return HouseholdVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -108,9 +108,9 @@ class CountPerson implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(PersonVoter::STATS);
return PersonVoter::STATS;
}
public function supportsModifiers()

View File

@ -98,9 +98,9 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -99,10 +99,9 @@ class CountSocialWorkActions implements ExportInterface, GroupedExportInterface
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
//TODO change to string, but changes needed also in ExportManager and possibly other locations.
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -355,9 +355,9 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou
return $qb;
}
public function requiredRole()
public function requiredRole(): string
{
return new Role(PersonVoter::LISTS);
return PersonVoter::LISTS;
}
public function supportsModifiers()

View File

@ -110,9 +110,9 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn
return $qb;
}
public function requiredRole(): Role
public function requiredRole(): string
{
return new Role(AccompanyingPeriodVoter::STATS);
return AccompanyingPeriodVoter::STATS;
}
public function supportsModifiers(): array

View File

@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActiveOnDateFilter implements FilterInterface
{
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActiveOneDayBetweenDatesFilter implements FilterInterface
{
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -32,7 +32,7 @@ class ActivityTypeFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class AdministrativeLocationFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class ClosingMotiveFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class ConfidentialFilter implements FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class CurrentUserJobFilter implements FilterInterface
$this->security = $security;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class CurrentUserScopeFilter implements FilterInterface
$this->security = $security;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class EmergencyFilter implements FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class EvaluationFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -34,7 +34,7 @@ use Symfony\Component\Form\FormBuilderInterface;
*/
class GeographicalUnitStatFilter implements FilterInterface
{
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -35,7 +35,7 @@ class IntensityFilter implements FilterInterface
$this->translator = $translator;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class OpenBetweenDatesFilter implements FilterInterface
{
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -30,7 +30,7 @@ class OriginFilter implements FilterInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -29,7 +29,7 @@ class ReferrerFilter implements FilterInterface
$this->userRender = $userRender;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

View File

@ -44,7 +44,7 @@ class RequestorFilter implements FilterInterface
$this->em = $em;
}
public function addRole()
public function addRole(): ?string
{
return null;
}

Some files were not shown because too many files have changed in this diff Show More