@ -7,3 +7,12 @@ class Union(Document):
description = StringField()
legal_registration_number = StringField()
headquarter = StringField()
def save(self,*args, **kwargs):
super(Union, self).save(*args, **kwargs)
from .Group import Group
group = Group()
group.union = self
group.name = 'Root'
group.rights = ["*::*::{}}/*".format(self.id)]
group.save()