Esempio n. 1
0
def create_report_permissions(sender, instance, created, **kwargs):
    group = Group.objects.get(name=instance.project.name)
    assign('view_report', group, instance)
Esempio n. 2
0
def create_group_and_project_permissions(sender, instance, created, **kwargs):
    group, created = Group.objects.get_or_create(name=instance.name)
    assign('view_project', group, instance)
Esempio n. 3
0
def create_subject_permissions(sender, instance, created, **kwargs):
    group = Group.objects.get(name=instance.iteration.project.name)
    assign('view_subject', group, instance)
Esempio n. 4
0
def create_projectactor_permissions_and_add_to_group(sender, instance, created, **kwargs):
    group = Group.objects.get(name=instance.project.name)
    instance.user.groups.add(group)
    assign('view_projectactor', group, instance)
    assign('edit_projectactor', instance.user, instance)