mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Remove usage of deprecated Role class
This commit is contained in:
@@ -294,9 +294,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*
|
||||
*
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
* @Assert\Email(
|
||||
* checkMX=true
|
||||
* )
|
||||
* @Assert\Email()
|
||||
*/
|
||||
private string $email = '';
|
||||
|
||||
|
@@ -81,7 +81,7 @@ class AccompanyingPeriodType extends AbstractType
|
||||
if ('visible' === $this->config['user']) {
|
||||
$builder->add('user', UserPickerType::class, [
|
||||
'center' => $options['center'],
|
||||
'role' => new Role(PersonVoter::SEE),
|
||||
'role' => PersonVoter::SEE,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -107,7 +107,7 @@ class PickPersonType extends AbstractType
|
||||
->addAllowedTypes('centers', ['array', Center::class, 'null'])
|
||||
->setDefault('centers', null)
|
||||
->setDefined('role')
|
||||
->addAllowedTypes('role', [Role::class, 'null'])
|
||||
->addAllowedTypes('role', ['string', 'null'])
|
||||
->setDefault('role', null);
|
||||
|
||||
// add the default options
|
||||
|
@@ -133,7 +133,7 @@ final class PickPersonTypeTest extends KernelTestCase
|
||||
$this->markTestSkipped('need to inject locale into url generator without request');
|
||||
$form = $this->formFactory
|
||||
->createBuilder(PickPersonType::class, null, [
|
||||
'role' => new \Symfony\Component\Security\Core\Role\Role('INVALID'),
|
||||
'role' => 'INVALID',
|
||||
])
|
||||
->getForm();
|
||||
|
||||
|
@@ -58,7 +58,7 @@ class PersonListWidget implements WidgetInterface
|
||||
// show only the person from the authorized centers
|
||||
$and = $qb->expr()->andX();
|
||||
$centers = $this->authorizationHelper
|
||||
->getReachableCenters($this->getUser(), new Role(PersonVoter::SEE));
|
||||
->getReachableCenters($this->getUser(), PersonVoter::SEE);
|
||||
$and->add($qb->expr()->in('person.center', ':centers'));
|
||||
$qb->setParameter('centers', $centers);
|
||||
|
||||
|
Reference in New Issue
Block a user