User Management Routes
This section documents the user management API endpoints.
backend.routes.users
Classes
UserManager
Bases: UUIDIDMixin, BaseUserManager[User, UUID]
Source code in backend/routes/users.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |
Functions
initialize_user_directories(user_id: str)
async
Create the necessary directory structure and default files for a new user.
Source code in backend/routes/users.py
authenticate(credentials: UserLogin) -> User | None
async
Custom authenticate method that supports login with username or email
Source code in backend/routes/users.py
Functions
login(credentials: UserLogin)
async
Custom login endpoint that accepts username or email
Source code in backend/routes/users.py
get_auth_config()
async
Get authentication configuration including inactivity threshold
Source code in backend/routes/users.py
admin_list_users(user: User = Depends(current_active_user))
async
List all users (admin only)
Source code in backend/routes/users.py
admin_create_user(user_data: AdminUserCreate, current_user: User = Depends(current_active_user))
async
Create a new user (admin only)
Source code in backend/routes/users.py
admin_update_user(user_id: str, user_data: UserUpdateRequest, current_user: User = Depends(current_active_user))
async
Update user details (admin only)
Source code in backend/routes/users.py
admin_promote_user(user_id: str, request: UserPromoteRequest, current_user: User = Depends(current_active_user))
async
Promote a user to superuser (admin only)
Source code in backend/routes/users.py
admin_demote_user(user_id: str, request: UserDemoteRequest, current_user: User = Depends(current_active_user))
async
Demote a superuser to regular user (admin only)
Source code in backend/routes/users.py
admin_delete_user(user_id: str, current_user: User = Depends(current_active_user))
async
Delete a user (admin only)
Source code in backend/routes/users.py
admin_get_stats(current_user: User = Depends(current_active_user))
async
Get system statistics (admin only)
Source code in backend/routes/users.py
admin_list_pending_approvals(current_user: User = Depends(current_active_user))
async
List users pending approval (admin only)
Source code in backend/routes/users.py
admin_approve_user(user_id: str, request: UserApprovalRequest, current_user: User = Depends(current_active_user))
async
Approve or reject a user (admin only)