I saw "Package sensio/framework-extra-bundle
is abandoned, you should avoid using it. Use Symfony instead."
but I use it in my Controller :
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
#[Security("is_granted('ROLE_USER') and user === choosenUser")]
#[Route('/movement/user/{id}', name: 'app_movement_user')]
public function.......
What I have to use now to keep Security ? Thanks
From Symfony 6.2, you can use native attribute #[IsGranted] with expressions.
Replace #[Security] by :
Sources :
https://symfony.com/blog/new-in-symfony-6-2-built-in-cache-security-template-and-doctrine-attributes
https://symfony.com/doc/current/security.html#access-control-authorization
Discussion in Symfony gitHub :
https://github.com/symfony/symfony/discussions/48878
Using Expressions in Security Access Controls :
https://symfony.com/doc/current/security/expressions.html
Take time to find and read documentation. :)