1. Kai Diefenbach
  2. django-permissions-1.0


Kai Diefenbach  committed f74ab58

Bugfix: has_permission, using roles=None as parameter

  • Participants
  • Parent commits c865c64
  • Branches default

Comments (0)

Files changed (1)

File permissions/utils.py

View file
     return True
-def has_permission(obj, user, codename, roles=[]):
+def has_permission(obj, user, codename, roles=None):
     """Checks whether the passed user has passed permission for passed object.
         If given these roles will be assigned to the user temporarily before
         the permissions are checked.
+    if roles is None:
+        roles = []
     if user.is_superuser:
         return True