Concepts
Authorization boundary
Check the authenticated actor’s permission for the specific resource and operation on the server. Local predicate below models a decision, not authentication.
Formal Syntax & Structure
javascript syntaxjavascript
authorize(actor, resource, action)Working Example
Example Snippetjavascript
(async () => {const allowed=(actor,record)=>actor.id===record.owner;console.log(allowed({id:"A"},{owner:"A"}),allowed({id:"B"},{owner:"A"}));})()