twig user has role code example
Example 1: check if user has role twig
{% if is_granted('ROLE_ADMIN') %} ... {% endif %}
Example 2: check twig if user has role
{% if is_granted('ROLE_ADMIN') %}
<a href="...">Delete</a>
{% endif %}
{% if is_granted('ROLE_ADMIN') %} ... {% endif %}
{% if is_granted('ROLE_ADMIN') %}
<a href="...">Delete</a>
{% endif %}