【发布时间】:2013-12-24 08:42:43
【问题描述】:
我正在为员工用户编写视图。
def my_view(request):
if request.user.is_staff:
# show something to staff
else:
return my_view_404(request)
这个权限检查就够了吗?有什么破绽吗?还是我应该检查 request.user.is_authenticated()?
【问题讨论】:
标签: django authentication django-authentication