backend.routers.admin
Admin router – user and system management.
All endpoints are protected by user_is_admin() which verifies
that the authenticated user holds the admin role.
Prefix: /admin | Tag: admin
- async backend.routers.admin.user_is_admin(request, db=Depends(dependency=<function get_db>, use_cache=True, scope=None))[source]
Router-level dependency: allow access only for admin users.
Reads the token from the request (header or cookie), validates it and checks the
adminrole.- Parameters:
request (Request) – Incoming FastAPI request.
db (Session) – Active database session.
- Returns:
Current user payload (
user_name,user_group).- Return type:
- Raises:
HTTPException 403 – If the authenticated user is not an admin.
HTTPException 401 – If authentication fails.
- backend.routers.admin.admin_update_soft_config(data, current=Depends(dependency=<function get_current_user>, use_cache=True, scope=None))[source]
- backend.routers.admin.get_all_users(db=Depends(dependency=<function get_db>, use_cache=True, scope=None))[source]
- backend.routers.admin.update_user(user_id, data, request, db=Depends(dependency=<function get_db>, use_cache=True, scope=None), current=Depends(dependency=<function get_current_user>, use_cache=True, scope=None))[source]
- backend.routers.admin.deactivate_user(user_id, request, db=Depends(dependency=<function get_db>, use_cache=True, scope=None), current=Depends(dependency=<function get_current_user>, use_cache=True, scope=None))[source]
- backend.routers.admin.activate_user(user_id, db=Depends(dependency=<function get_db>, use_cache=True, scope=None))[source]