mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Remove usage of deprecated Role class
This commit is contained in:
@@ -52,7 +52,7 @@ class NotificationType extends AbstractType
|
||||
'empty_collection_explain' => 'notification.Any email',
|
||||
'entry_options' => [
|
||||
'constraints' => [
|
||||
new NotNull(), new NotBlank(), new Email(['checkMX' => true]),
|
||||
new NotNull(), new NotBlank(), new Email(),
|
||||
],
|
||||
'label' => 'Email',
|
||||
],
|
||||
|
@@ -97,7 +97,7 @@ trait AppendScopeChoiceTypeTrait
|
||||
*/
|
||||
protected function appendScopeChoices(
|
||||
FormBuilderInterface $builder,
|
||||
Role $role,
|
||||
string $role,
|
||||
Center $center,
|
||||
User $user,
|
||||
AuthorizationHelper $authorizationHelper,
|
||||
|
@@ -52,7 +52,7 @@ class ScopePickerType extends AbstractType
|
||||
array_filter(
|
||||
$this->authorizationHelper->getReachableScopes(
|
||||
$this->security->getUser(),
|
||||
$options['role'] instanceof Role ? $options['role']->getRole() : $options['role'],
|
||||
$options['role'],
|
||||
$options['center']
|
||||
),
|
||||
static fn (Scope $s) => $s->isActive()
|
||||
@@ -92,6 +92,6 @@ class ScopePickerType extends AbstractType
|
||||
->setAllowedTypes('center', [Center::class, 'array', 'null'])
|
||||
// create ``role` option
|
||||
->setRequired('role')
|
||||
->setAllowedTypes('role', ['string', Role::class]);
|
||||
->setAllowedTypes('role', ['string']);
|
||||
}
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ class UserPickerType extends AbstractType
|
||||
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class, 'null', 'array'])
|
||||
// create ``role` option
|
||||
->setRequired('role')
|
||||
->setAllowedTypes('role', ['string', \Symfony\Component\Security\Core\Role\Role::class]);
|
||||
->setAllowedTypes('role', ['string']);
|
||||
|
||||
$resolver
|
||||
->setDefault('having_permissions_group_flag', null)
|
||||
@@ -74,11 +74,7 @@ class UserPickerType extends AbstractType
|
||||
->setDefault('scope', null)
|
||||
->setAllowedTypes('scope', [Scope::class, 'array', 'null'])
|
||||
->setNormalizer('choices', function (Options $options) {
|
||||
if ($options['role'] instanceof Role) {
|
||||
$role = $options['role']->getRole();
|
||||
} else {
|
||||
$role = $options['role'];
|
||||
}
|
||||
$role = $options['role'];
|
||||
$users = $this->userACLAwareRepository
|
||||
->findUsersByReachedACL($role, $options['center'], $options['scope'], true);
|
||||
|
||||
|
@@ -159,7 +159,7 @@ class WorkflowStepType extends AbstractType
|
||||
'empty_collection_explain' => 'workflow.Any email',
|
||||
'entry_options' => [
|
||||
'constraints' => [
|
||||
new NotNull(), new NotBlank(), new Email(['checkMX' => true]),
|
||||
new NotNull(), new NotBlank(), new Email(),
|
||||
],
|
||||
'label' => 'Email',
|
||||
],
|
||||
|
Reference in New Issue
Block a user