문제

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?

Specifically I want check to see if a user has the role ROLE_ADMIN.

Any help?

Thanks

도움이 되었습니까?

해결책

{% if is_granted('ROLE_ADMIN') %} ... {% endif %}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top