User Routes
Users Routes Documentation
Overview
The Users routes manage user-related functionalities, such as retrieving, updating, and deleting user information.
Route Details
-
GET /
/users- Controller:
getAllUsers - Middleware:
ensureAdmin - Functionality: Retrieves a list of all users. Accessible only to admins.
- Controller:
-
GET /
- Controller:
getOneUser - Middleware:
ensureCorrectUserOrAdmin - Functionality: Retrieves details of a specific user. Accessible to the user themselves or an admin.
- Controller:
-
PUT /
- Controller:
updateUser - Middleware:
ensureCorrectUserOrAdmin - Functionality: Updates details of a specific user. Accessible to the user themselves or an admin.
- Controller:
-
DELETE /
- Controller:
deleteUser - Middleware:
ensureAdmin - Functionality: Deletes a specific user. Accessible only to admins.
- Controller:
Improvements
- Implement more granular access controls and audit logs for sensitive operations, especially update and delete operations.
- Regularly review user access patterns to ensure compliance with privacy and security best practices.
Notes
- Ensuring data privacy and adhering to