← API Security learning path
API Security · Module 3 of 8

Authorisation: object and function level

Check what this caller may do with this exact record.

📖 Key ideas

  1. Authorisation answers 'what may you do?' and must be checked on the server for every request.
  2. Object-level: when a request asks for order 1042, confirm the order belongs to this user or their organisation.
  3. Function-level: admin actions must check the admin role on the server, not only hide admin screens.
  4. Property-level: let users change only allowed fields; never accept 'role' or 'isAdmin' from client input.
  5. Deny by default: if no rule allows an action, refuse it.
💡 Real-life example: A hotel key card opens your room, not every room on the floor; the lock checks the card against the room number every single time.
AuthorisationChecking what the caller is allowed to do
Object-level checkConfirming the caller may access this specific record
Deny by defaultRefuse unless a rule explicitly allows
Mass assignmentBlindly copying all client fields into a record