Symfony2 security functions in Twig? How to check the user's role?

前端 未结 1 1456
失恋的感觉
失恋的感觉 2020-12-08 03:26

I have Symfony 2.0.9 standard edition installed with JMSSecurityBundle. Just wondering what functions are available to me in a Twig template to deal with users?

Spe

1条回答
  •  伪装坚强ぢ
    2020-12-08 04:28

    {% if is_granted('ROLE_ADMIN') %} ... {% endif %}
    

    0 讨论(0)
提交回复
热议问题