blob: c5edc31cd8207546c8af50608754f01f08872476 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!/usr/bin/python
import sys
group_name = sys.argv[1]
permission = sys.argv[2]
from django.contrib.auth.models import Group,Permission
g = Group.objects.get(name=group_name)
p = Permission.objects.get(codename=permission)
g.permissions.add(p)
g.save()
|