Refactor settings system and improve context initialization
Backend: - Add type validation and coercion for settings API - Implement SettingStorage and SettingType in registry - Improve CRUD operations for settings Frontend: - Refactor Theme, Language, Sidebar, ViewMode contexts - Simplify admin components (GeneralTab, SettingsTab, UsersTab) - Add new settings endpoints to API client - Improve App initialization flow Infrastructure: - Update Dockerfile and docker-compose.yml - Add .dockerignore - Update Makefile and README 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,10 +88,14 @@ def update_user(
|
||||
|
||||
# Only superusers can change is_superuser and is_active
|
||||
if not current_user.is_superuser:
|
||||
if user_in.is_superuser is not None or user_in.is_active is not None:
|
||||
if (
|
||||
user_in.is_superuser is not None
|
||||
or user_in.is_active is not None
|
||||
or user_in.permissions is not None
|
||||
):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Only admins can change user status"
|
||||
detail="Only admins can change user status or permissions"
|
||||
)
|
||||
|
||||
user = crud.user.update(db, db_obj=user, obj_in=user_in)
|
||||
|
||||
Reference in New Issue
Block a user