A new feature in Symfony 7.3 is arriving for these use cases:
https://symfony.com/blog/new-in-symfony-7-3-arbitrary-user-permission-checks