79704701

Date: 2025-07-17 11:19:45
Score: 0.5
Natty:
Report link

For anyone who stubles upon this question in 2025, from Symfony 7.3 on there is now a builtin solution for that:

$this->security->isGrantedForUser($user, 'ROLE_SALES_EXECUTIVE')

or as a twig function:

is_granted_for_user(another_user, 'ROLE_SALES_EXECUTIVE')
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Thomas