rector-symfony icon indicating copy to clipboard operation
rector-symfony copied to clipboard

[Symfony 4.4] Updating AuthorizationCheckerIsGrantedExtractorRector

Open stefantalen opened this issue 1 year ago • 3 comments

Felt like this rule was missing the AbstractController implementation.

This PR will add AbstractController::isGranted() and AbstractController::denyAccessUnlessGranted() support

stefantalen avatar Feb 14 '24 13:02 stefantalen

Looks good, ready to merge?

TomasVotruba avatar Feb 14 '24 13:02 TomasVotruba

Hold your horses 😬 I need to work on the denyUnlessGranted() implementation

stefantalen avatar Feb 14 '24 13:02 stefantalen

I'm looking for the right return type to get from a MethodCall

$this->denyAccessUnlessGranted(['ROLE_USER', 'ROLE_ADMIN']);

To

$this->denyAccessUnlessGranted('ROLE_USER');
$this->denyAccessUnlessGranted('ROLE_ADMIN');

Using the current processExtractIsGranted, the result is

$this->denyAccessUnlessGranted('ROLE_USER') || $this->denyAccessUnlessGranted('ROLE_ADMIN');

So I was thinking on replacing the BooleanOr for something else, but am kind of lost 😨

stefantalen avatar Feb 14 '24 14:02 stefantalen