person document: fix use of deprecated role class

This commit is contained in:
2021-12-17 00:33:02 +01:00
parent 773aee5534
commit 36890a2256
4 changed files with 10 additions and 7 deletions

View File

@@ -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);