← API Security learning pathAPI Security · Module 3 of 8
Authorisation: object and function level
Check what this caller may do with this exact record.
📖 Key ideas
- Authorisation answers 'what may you do?' and must be checked on the server for every request.
- Object-level: when a request asks for order 1042, confirm the order belongs to this user or their organisation.
- Function-level: admin actions must check the admin role on the server, not only hide admin screens.
- Property-level: let users change only allowed fields; never accept 'role' or 'isAdmin' from client input.
- 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