Creates an instance of UserController.
Service layer for user business logic
Retrieves the current authenticated user's profile information.
Handles GET /api/users/profile endpoint. Requires authentication.
Express request object containing user authentication data
Express response object
Promise that resolves when response is sent
Updates the current authenticated user's profile information.
Handles PUT /api/users/profile endpoint. Requires authentication. Implements whitelist pattern for security hardening.
Express request object with profile updates in body
Express response object
Promise that resolves when response is sent
Updates the current authenticated user's password.
Handles PUT /api/users/password endpoint. Requires authentication and current password verification.
Express request object with password change data in body
Express response object
Promise that resolves when response is sent
Retrieves paginated list of all users with filtering and sorting options (administrative function).
Handles GET /api/users endpoint. Requires admin role. Supports query parameters for pagination, filtering, and sorting.
Express request object with query parameters for filtering and pagination
Express response object
Promise that resolves when response is sent
Retrieves detailed information for a specific user by ID (administrative function).
Handles GET /api/users/:id endpoint. Requires admin role.
Express request object with user ID in params
Express response object
Promise that resolves when response is sent
Updates a specific user's role (administrative function).
Handles PUT /api/users/:id/role endpoint. Requires admin role.
Express request object with user ID in params and role data in body
Express response object
Promise that resolves when response is sent
HTTP API controller for user profile management operations.
UserController