Authorization Best Practices
A practical guide to authorization for developers who build apps where users should only see and change some of the data. It covers deny by default and server-side checks, object-level authorization against IDOR and BOLA, choosing between RBAC, ABAC and ReBAC, multi-tenant isolation with row-level security, policy engines, admin and support access, auditing, and testing that permissions actually hold.
7
Sefism · Oct 2026
22
Sefism · Oct 2026
8
Sefism · Oct 2026
Security
Sefism · Oct 2026
Best practices
Other
Sefism
21 min read
Intermediate
Free
What this best practices guide is
A practical guide to authorization for developers who build apps where users should only see and change some of the data. It covers deny by default and server-side checks, object-level authorization against IDOR and BOLA, choosing between RBAC, ABAC and ReBAC, multi-tenant isolation with row-level security, policy engines, admin and support access, auditing, and testing that permissions actually hold.
It has 7 chapters and 22 practices, each with why it matters, what to do and what to avoid. For developers who build apps with users and permissions.
Chapter by chapter
1. Deny by default, check on the server (3 practices)
The three rules every other practice builds on: nothing is allowed unless a rule says so, the check runs on the server for every request, and an error means no.
2. Object-level authorization: stop IDOR and BOLA (4 practices)
Checking that a user may call an endpoint is not enough. Each object they ask for, by ID, has to belong to something they may access.
3. Choosing a model: RBAC, ABAC and ReBAC (3 practices)
Roles, attributes and relationships each answer "may this user do this?" differently. Pick the one that matches how your product actually shares data.
4. Multi-tenant isolation (3 practices)
In a SaaS app, the worst authorization bug is one tenant seeing another tenant's data. Isolation has to hold in the database, the cache and every background job.
5. Policy engines, tokens and services (3 practices)
As an app grows, authorization logic moves out of controllers into one decision point. These practices keep that decision correct across services and tokens.
6. Admin access, support access and auditing (3 practices)
Admins and support staff can see the most data, so their access needs the most care: separate controls, time limits and a record of what they did.
7. Testing authorization (3 practices)
Permissions break silently: nothing crashes, the wrong person just sees the data. Automated tests are how you notice before they do.
How it works on Sefism
The guide reads like a short course: a syllabus, then one chapter per page in a focused reader, with a quiz at the end of each chapter for members. The opening chapters are open to everyone. Adding it to your account uses credits, opens every chapter and keeps your progress.
Every claim is checked against the sources listed on the page (8 cited).
Ready to start?
Opens on Sefism in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.