title: Get ROLE of a user not logged in TWIG Symfony2
body: <p>I would like to know how can i know if a user is granted when it's not the current user in twig.</p>
  
  <p>I use this code for the current user:</p>
  
  <pre><code>{% if is_granted('ROLE_USER') %}
      &lt;a href="..."&gt;Delete&lt;/a&gt;
  {% endif %}
  </code></pre>
  
  <p>But i would like to be able to do the same thing with ohter users that are not logged in at the moment.
  Thank you.</p>
  
  <p><strong>Edit:</strong>
  In fact i think there isn't a direct way with twig to test role of a user that is not authenticated.
  So i did it directly in the twig template, test if a user is admin or not, then set var.
  (in my question i was searching how to do in a list of users.)</p>
  
  <pre><code>{% set from_user_is_admin = false %}
  {% for role in from_user.getRoles() %} 
      {% if role == 'ROLE_ADMIN' %}{% set from_user_admin = true %}{% endif %}
      {% if role == 'ROLE_SUPER_ADMIN' %}{% set from_user_admin = true %}{% endif %}
  {% endfor %}
  {% if from_user_admin == false %}THIS USER IS NOT ADMIN{% endif %}
  </code></pre>