mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-18 12:19:29 +00:00
Added command to update the permissions in the DB
This commit is contained in:
11
app/tools/management/commands/updatepermissions.py
Normal file
11
app/tools/management/commands/updatepermissions.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.contrib.auth.management import create_permissions
|
||||
from django.db.models import get_apps
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
help = "Updates the application permissions stored in the DB"
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
for app in get_apps():
|
||||
create_permissions(app, None, 2)
|
||||
|
||||
Reference in New Issue
Block a user