In Django book, page 189, authors are using following code:

def vote(request):
  if request.user.is_authenticated and
request.user.has_permit("polls.can_vote"):
    #vote here
  else:
    return HttpResponse("")

Why first condition?  Why checking is user authenticated?  Doesn't the
request.user.has_permit("polls.can_vote) already imply that user is
authenticated?  Can anonymous users have permissions?  If they can,
and if  they can vote, why than checking for authentication?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to