Commit 95f16415 by Őry Máté

acl: add AclBase.clone_acl

parent d4c7fdc3
......@@ -71,6 +71,17 @@ class AclBase(Model):
"""Define permission levels for Users/Groups per object."""
object_level_set = GenericRelation(ObjectLevel)
def clone_acl(self, other):
"""Clone full ACL from other object."""
assert != or type(self) != type(other)
for i in other.object_level_set.all():
ol = self.object_level_set.create(level=i.level)
for j in i.users.all():
for j in i.groups.all():
def get_level_object(cls, level):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment