

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
Choosing an access control model isn't about one being better than the other. It's about which trusted facts a policy needs.
Role-Based Access Control (RBAC) asks:
What role does this user have?
Attribute-Based Access Control (ABAC) asks:
What is true about this user, this resource, this action, and this request?
RBAC is a natural fit when permissions follow a user's job or responsibility. It's popular in business-to-business (B2B) SaaS applications where users have stable roles like admin, support, or accountant.
ABAC is a better fit when the decision depends on a more complex relationship, resource state, or request context. For example, an ecommerce shop might allow a promo code to be applied to a cart only if:
Real applications often use both RBAC and ABAC. That's okay!
RBAC and ABAC are not mutually exclusive models, and a role can itself be treated as a user's attribute. Use the simplest model your application needs so its authorization policies stay easy to understand and maintain.
Use RBAC when a stable role captures the whole rule. Use ABAC when the decision depends on ownership, state, or context. Combine them when both kinds of facts matter.