Protect user role from deletion and use action sound asset

This commit is contained in:
Jage9
2026-02-27 19:15:13 -05:00
parent 7d25cc226f
commit d522ba10a8
4 changed files with 17 additions and 6 deletions

View File

@@ -330,8 +330,8 @@ class AuthService:
normalized_role = self._normalize_role_name(role_name)
normalized_replacement = self._normalize_role_name(replacement_role_name)
if normalized_role == "admin":
raise AuthError("Admin role cannot be deleted.")
if normalized_role in {"admin", "user"}:
raise AuthError("Admin and user roles cannot be deleted.")
if normalized_role == normalized_replacement:
raise AuthError("Replacement role must differ from deleted role.")