mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
person document: fix use of deprecated role class
This commit is contained in:
parent
773aee5534
commit
36890a2256
@ -24,7 +24,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
@ -100,7 +99,7 @@ class DocumentPersonController extends AbstractController
|
||||
$document,
|
||||
[
|
||||
'center' => $document->getCenter(),
|
||||
'role' => new Role('CHILL_PERSON_DOCUMENT_UPDATE'),
|
||||
'role' => 'CHILL_PERSON_DOCUMENT_UPDATE',
|
||||
]
|
||||
);
|
||||
$form->handleRequest($request);
|
||||
@ -160,7 +159,7 @@ class DocumentPersonController extends AbstractController
|
||||
$reachableScopes = $this->authorizationHelper
|
||||
->getReachableScopes(
|
||||
$this->getUser(),
|
||||
new Role(PersonDocumentVoter::SEE),
|
||||
PersonDocumentVoter::SEE,
|
||||
$person->getCenter()
|
||||
);
|
||||
|
||||
@ -204,7 +203,7 @@ class DocumentPersonController extends AbstractController
|
||||
|
||||
$form = $this->createForm(PersonDocumentType::class, $document, [
|
||||
'center' => $document->getCenter(),
|
||||
'role' => new Role('CHILL_PERSON_DOCUMENT_CREATE'),
|
||||
'role' => 'CHILL_PERSON_DOCUMENT_CREATE',
|
||||
]);
|
||||
$form->handleRequest($request);
|
||||
|
||||
|
@ -93,7 +93,7 @@ class PersonDocumentType extends AbstractType
|
||||
]);
|
||||
|
||||
$resolver->setRequired(['role', 'center'])
|
||||
->setAllowedTypes('role', [\Symfony\Component\Security\Core\Role\Role::class])
|
||||
->setAllowedTypes('role', ['string'])
|
||||
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class]);
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,11 @@
|
||||
{{ form_row(form.title) }}
|
||||
{{ form_row(form.date) }}
|
||||
{{ form_row(form.category) }}
|
||||
|
||||
{% if form.scope is defined %}
|
||||
{{ form_row(form.scope) }}
|
||||
{% endif %}
|
||||
|
||||
{{ form_row(form.description) }}
|
||||
{{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class ScopePickerType extends AbstractType
|
||||
{
|
||||
$items = $this->authorizationHelper->getReachableScopes(
|
||||
$this->security->getUser(),
|
||||
$options['role']->getRole(),
|
||||
$options['role'] instanceof Role ? $options['role']->getRole() : $options['role'],
|
||||
$options['center']
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user