Cannot get role information in twig file
Displaying content if the user has a certain role:

{% if 'content_administrator' in user.getroles %}
  &lt;p&gt;Only displayed for the role Content Administrator&lt;/p&gt;
{% endif %}


More info: Restrict content to a user role in a template file