mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
Remove usage of deprecated Role class
This commit is contained in:
@@ -116,7 +116,7 @@ class SingleTaskListType extends AbstractType
|
||||
'centers' => $this->authorizationHelper
|
||||
->getReachableCenters(
|
||||
$this->tokenStorage->getToken()->getUser(),
|
||||
new Role(TaskVoter::SHOW)
|
||||
TaskVoter::SHOW
|
||||
),
|
||||
'required' => false,
|
||||
'label' => 'Associated person',
|
||||
@@ -160,7 +160,7 @@ class SingleTaskListType extends AbstractType
|
||||
protected function getReachablesCenters()
|
||||
{
|
||||
$user = $this->tokenStorage->getToken()->getUser();
|
||||
$role = new Role(TaskVoter::SHOW);
|
||||
$role = TaskVoter::SHOW;
|
||||
|
||||
return $this->authorizationHelper->getReachableCenters($user, $role);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ class SingleTaskListType extends AbstractType
|
||||
{
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
$user = $this->tokenStorage->getToken()->getUser();
|
||||
$role = new Role(TaskVoter::SHOW);
|
||||
$role = TaskVoter::SHOW;
|
||||
$centers = $this->authorizationHelper->getReachableCenters($user, $role);
|
||||
|
||||
$qb->select('DISTINCT task.type AS type')
|
||||
@@ -237,7 +237,7 @@ class SingleTaskListType extends AbstractType
|
||||
{
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
$user = $this->tokenStorage->getToken()->getUser();
|
||||
$role = new Role(TaskVoter::SHOW);
|
||||
$role = TaskVoter::SHOW;
|
||||
$centers = $this->authorizationHelper->getReachableCenters($user, $role);
|
||||
|
||||
$qb->select('DISTINCT user')
|
||||
|
@@ -78,6 +78,6 @@ class SingleTaskType extends AbstractType
|
||||
{
|
||||
$resolver
|
||||
->setRequired('role')
|
||||
->setAllowedTypes('role', [Role::class, 'string']);
|
||||
->setAllowedTypes('role', ['string']);
|
||||
}
|
||||
}
|
||||
|
@@ -159,7 +159,7 @@ class SingleTaskRepository extends EntityRepository
|
||||
. '`setAuthorizationHelper`');
|
||||
}
|
||||
|
||||
$role = new Role(TaskVoter::SHOW);
|
||||
$role = TaskVoter::SHOW;
|
||||
$qb->join('st.person', 'p');
|
||||
|
||||
$centers = $this->authorizationHelper
|
||||
|
@@ -168,7 +168,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
|
||||
foreach (
|
||||
$this->authorizationHelper->getReachableCenters(
|
||||
$this->security->getUser(),
|
||||
new Role(ActivityVoter::SEE_DETAILS)
|
||||
ActivityVoter::SEE_DETAILS
|
||||
) as $center
|
||||
) {
|
||||
if (false === in_array($center, $centers, true)) {
|
||||
@@ -181,7 +181,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
|
||||
// we loop over circles
|
||||
$circles = $this->authorizationHelper->getReachableCircles(
|
||||
$this->security->getUser(),
|
||||
new Role(ActivityVoter::SEE_DETAILS),
|
||||
ActivityVoter::SEE_DETAILS,
|
||||
$center
|
||||
);
|
||||
$circleIds = [];
|
||||
@@ -234,7 +234,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
|
||||
// we loop over circles
|
||||
$circles = $this->authorizationHelper->getReachableCircles(
|
||||
$this->security->getUser(),
|
||||
new Role(ActivityVoter::SEE_DETAILS),
|
||||
ActivityVoter::SEE_DETAILS,
|
||||
$personArg->getCenter()
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user