转载:http://maplye.iteye.com/blog/448960
记录下自己用到的:
1.Permissions{{ perms.foo }},一个已经登陆的用户对foo的app只要有任何的权限,{{ perms.foo }}就会等于True,反之为False{{ perms.foo.can_vote }}, 这个很清楚了...实例如下:
{% if perms.foo %}
<p>You have permission to do something in the foo app.</p>
{% if perms.foo.can_vote %}
<p>You can vote!</p>
{% endif %}
{% if perms.foo.can_drive %}
<p>You can drive!</p>
{% endif %}
{% else %}
<p>You don't have permission to do anything in the foo app.</p>{% endif %}