Django - How to add multiple permissions on group?

Viewed 256

I have a list of permissions

list = ['view', 'add', 'edit']

The permissions inside the list are already saved on my table.

I first clear the group's previous permission so I can insert a new one

group = Group.objects.get(name='Group1')
group.permissions.clear()

Is there a way to add the list of permission to Group1 programmatically?

0 Answers
Related