I want to check if a role is not granted. I have to display something only for USER but MANAGER is the hierarchy above.
To get that I am doing:
{% if is_granted('ROLE_MANAGER') %} {% else %} my message {% endif %}
Which is not really nice. What can be the correct syntax for:
{% if is_NOT_granted('ROLE_MANAGER') %}
ideas?
Or again
{% if not is_granted('ROLE_MANAGER') %} my message {% endif %}
You can simply check as follow:
{% if is_granted('ROLE_MANAGER') == false %} my message {% endif %}
Hope this help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With