17

I'm wondering why this code section prints out the following:

print "request.user.has_perm('bug_tracking.is_developer'): " + str(request.user.has_perm('bug_tracking.is_developer'))
                    print request.user.get_all_permissions()

request.user.has_perm('bug_tracking.is_developer'): True
set([])

I would expect that request.user.has_perm('bug_tracking.is_developer') returns false if the list of all permissions is empty!?

Thomas Kremmel
  • 14,575
  • 26
  • 108
  • 177

2 Answers2

33

huups...was a super user ;-)

Superuser status Designates that this user has all permissions without explicitly assigning them.

Thomas Kremmel
  • 14,575
  • 26
  • 108
  • 177
0

Also note that if you have a method has_perm in you User model, the authentication backends' has_perm methods will not called ever.

Saleh
  • 1,819
  • 1
  • 17
  • 44