i've a problem to get role_admin or role_user in twig.
AND
if {{ dump(app.user.roles) }}
then
Then {% if is_granted('ROLE_ADMIN') %}
not working
So, where is the problem ?
Thanks.
If you want to check if value exists (same as in_array()
in PHP):
{% if 'ROLE_ADMIN' in app.user.roles %}