feat: implement user management system
- Add role field to UserProfile (superadmin/admin/trainer) - Add role-based permission classes - Create UserManagementViewSet with CRUD and password change - Add API types and components for user management - Create users management page in settings - Only superadmins can manage users
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 4.2.29 on 2026-03-26 15:35
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("auth_app", "0004_userprofile"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="userprofile",
|
||||
name="role",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("superadmin", "Super Admin"),
|
||||
("admin", "Admin"),
|
||||
("trainer", "Trainer"),
|
||||
],
|
||||
default="trainer",
|
||||
max_length=20,
|
||||
),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user