Esempio n. 1
0
    def handle(self, *args, **options):
        create_groups()
        create_permissions()

        for group_name, code_names in GROUP_PERMISSIONS.iteritems():
            group = Group.objects.get(name=group_name)
            group_permissions = []
            for codename in code_names:
                group_permissions.append(Permission.objects.get(codename=codename))

            group.permissions = group_permissions
            group.save()
Esempio n. 2
0
    def handle(self, *args, **options):
        create_groups()
        create_permissions()

        for group_name, code_names in GROUP_PERMISSIONS.iteritems():
            group = Group.objects.get(name=group_name)
            group_permissions = []
            for codename in code_names:
                group_permissions.append(
                    Permission.objects.get(codename=codename))

            group.permissions = group_permissions
            group.save()
Esempio n. 3
0
 def setUpClass(cls):
     create_groups()
     create_permissions()
     call_command('setup_permissions')