Roles and Ownership: 401 or 403
Signed in isn't the same as allowed, so a requireRole middleware lets only the right role through, an ownership check compares a record's owner with req.user.id, and both refuse with 403, while 401 stays for a request with no valid token.
Updated

- Category
- Node.js
- Level
- Journeyman
- Tags
- 401 Unauthorized, 403 Forbidden, Authorization, nodejs, Ownership Check, rest-api, Role-Based Access Control (rest-api)