Commits

Kai Diefenbach  committed 3c915fa

has_permission: take global roles of groups into account

  • Participants
  • Parent commits e36a0b3

Comments (0)

Files changed (1)

File permissions/utils.py

     if isinstance(principal, User):
         for group in principal.groups.all():
             roles.extend(get_local_roles(obj, group))
+            roles.extend(get_roles(group))
 
     return roles
 
 
     role.delete()
     return True
-    
+
 def register_group(name):
     """Registers a group with passed name to the framework. Returns the new
     group if the registration was successfully, otherwise False.
-    
+
     Actually this creates just a default Django Group.
 
     **Parameters:**
     return group
 
 def unregister_group(name):
-    """Unregisters the group with passed name. Returns True if the 
+    """Unregisters the group with passed name. Returns True if the
     unregistration was succesfull otherwise False.
 
     Actually this deletes just a default Django Group.
         return False
 
     group.delete()
-    return True    
+    return True