# Roles and Ownership

Roles and Ownership: Roles and Ownership: 401 or 403.

Updated: November 19, 2026

1. [Roles and Ownership: 401 or 403](https://www.ask-codey.com/lessons/node-auth-roles-and-ownership) (Journeyman): 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.

Source: https://www.ask-codey.com/courses/nodejs-in-depth/topics/node-auth-roles
