InterviewBuddy
All interview questions

How can an Express service enforce resource-level authorization?

Advanced

Answer

Authenticate the caller, then verify permission for the specific resource and action on the server before reading or modifying it.

Explanation

A valid login or user-supplied owner ID does not prove access.

Example

Load order 42 only if the caller owns it or has an allowed role.