diff --git a/program/management/commands/addpermissions.py b/program/management/commands/addpermissions.py index 40147440bc98ab7c195dbdfda0d212916606da0e..3eef524ca44e5b368cd60115e8efb3022dd681ac 100644 --- a/program/management/commands/addpermissions.py +++ b/program/management/commands/addpermissions.py @@ -12,7 +12,7 @@ class Command(BaseCommand): codename__startswith="edit" ) self.stdout.write( - f" Adding app permissions to the '{program_group}' group... ", + f"Adding app permissions to the '{program_group}' group... ", ending="", ) self.stdout.flush() @@ -24,7 +24,7 @@ class Command(BaseCommand): content_type__model__in=["note", "notelink"] ).exclude(codename__startswith="edit") self.stdout.write( - f" Adding model permissions on note & notelink to the '{host_group}' group... ", + f"Adding model permissions on note & notelink to the '{host_group}' group... ", ending="", ) self.stdout.flush() @@ -32,11 +32,21 @@ class Command(BaseCommand): self.stdout.write(self.style.SUCCESS(len(model_permissions))) host_plus_group = Group.objects.get(name=settings.ENTITLED_GROUPS[1]) + change_permissions = Permission.objects.filter( + codename__startswith="change", content_type__model__in=["host", "note", "show"] + ) + self.stdout.write( + f"Adding change permissions on host, note & show to the '{host_plus_group}' group... ", + ending="", + ) + host_plus_group.permissions.add(*change_permissions) + self.stdout.write(self.style.SUCCESS(len(change_permissions))) + self.stdout.flush() edit_permissions = Permission.objects.filter( codename__startswith="edit", content_type__model__in=["host", "note", "show"] ) self.stdout.write( - f" Adding edit permissions on host, note & show to the '{host_plus_group}' group... ", + f"Adding edit permissions on host, note & show to the '{host_plus_group}' group... ", ending="", ) self.stdout.flush()