feat: add RBAC migrations, user modules, admin API updates, and utility scripts
This commit is contained in:
19
user.py
Normal file
19
user.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
import django
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eventify.settings")
|
||||
django.setup()
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
User = get_user_model()
|
||||
|
||||
def make_all_users_admin():
|
||||
users = User.objects.all()
|
||||
for user in users:
|
||||
user.role = "admin" # assuming role field exists
|
||||
user.save()
|
||||
print(f"Updated: {user.username} -> Admin")
|
||||
|
||||
if __name__ == "__main__":
|
||||
make_all_users_admin()
|
||||
print("All users updated to admin role!")
|
||||
Reference in New Issue
Block a user