2014-03-07 129 views

回答

0

http://symfony.com/doc/current/book/security.html - 搜索is_granted

在您的树枝模板:

{% if is_granted('ROLE_ADMIN') %} 
    {{ form_row(form.somthingOnlyTheAdminGetsToSee) }} 
{% endif %} 

请记住,这将是最好创建角色的具体形式。黑客仍然可以发布管理字段。

相关问题