2014-03-07 63 views

回答

0

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

在您的樹枝模板:

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

請記住,這將是最好創建角色的具體形式。黑客仍然可以發佈管理字段。

相關問題