

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Principle of Least Privilege
incomplete
2: Preventing Broken Access Control
incomplete
3: Don't Trust the Client
incomplete
4: Access Control Models
incomplete
5: Attribute-Based Access Control
incomplete
6: RBAC vs. ABAC
incomplete
7: Insecure Direct Object References
incomplete
8: Securing File Downloads
incomplete
9: Signed URLs
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Once an application has more than a few protected routes, repeated and inconsistent authorization checks become hard to keep track of. An access control model gives those checks a consistent structure.
Role-Based Access Control (RBAC) assigns permissions to roles, then roles to users. For example, you may have roles like:
developer for API access but no financial dataaccountant for financial-only accessowner for complete ownership of all resourcesInstead of hard-coding 14 different if/else permission checks into every route, you can write a shared helper that accepts the current user and the allowed roles, then rejects the request if the user's role isn't allowed.
Centralization doesn't change who is allowed to do what. It makes authentication and role evaluation easier to find, review, and apply consistently. Poorly organized code isn't inherently insecure, but it's more likely to become insecure as it changes.
Scattered copies of a policy drift. One copy gets a bug fix, another doesn't. One is written as an allowlist that denies by default, another only checks the roles its author was thinking about that day and quietly lets everyone else through. A single shared helper means there's one place to get it right.
RBAC works well when permissions follow stable job functions. Its tradeoff is rigidity. As systems grow, teams sometimes invent increasingly specific roles like admin-read-only, editor-plus, or support-admin. That can lead to role explosion.