Commits

Florian Hahn committed 77dbf63

add method _get_permission_list to ObjectPermission

Comments (0)

Files changed (2)

object_permission_backend_nonrel/backends.py

     def _create_permission_strings(self, permission_objs):
         new_perms = []
         for p in permission_objs:
-                for perm in p.permission_list:
+                for perm in p._get_permission_list():
                     new_perms.append(PERM_STRING_TEMPLATE % (p.content_type, p.object_id, perm))
         return new_perms
 

object_permission_backend_nonrel/models.py

     user = models.ForeignKey(User, null=True)
 
     permission_list = ListField(models.CharField(max_length=64))
-                            
+
     content_type = models.CharField(max_length=256)
     object_id = models.PositiveIntegerField()
 
+    def _get_permission_list(self):
+        return self.permission_list
+    
 
 class GroupObjectPermission(models.Model):
     group = models.ForeignKey(Group, null=True)
     content_type = models.CharField(max_length=256)
     object_id = models.PositiveIntegerField()
 
+    def _get_permission_list(self):
+        return self.permission_list
 
 class PermissionType(models.Model):
     content_type = models.CharField(max_length=256)