feat: add Teacher Admin role to four-tier permission system
Introduces a four-tier role system: Regular User → Student Admin → Teacher Admin → Super Admin. Teacher Admin can manage own contests, problemsets, and view classroom data. Student Admin (renamed from Admin) retains problem management only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
27
account/migrations/0007_rename_admin_to_student_admin.py
Normal file
27
account/migrations/0007_rename_admin_to_student_admin.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 6.0.4 on 2026-06-03 00:08
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rename_admin_to_student_admin(apps, schema_editor):
|
||||
User = apps.get_model("account", "User")
|
||||
User.objects.filter(admin_type="Admin").update(admin_type="Student Admin")
|
||||
|
||||
|
||||
def rename_student_admin_to_admin(apps, schema_editor):
|
||||
User = apps.get_model("account", "User")
|
||||
User.objects.filter(admin_type="Student Admin").update(admin_type="Admin")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("account", "0006_alter_user_admin_type"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
rename_admin_to_student_admin,
|
||||
rename_student_admin_to_admin,
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user