Skip to content

Commit 5158127

Browse files
Merge pull request #91 from WebDevSimplified/add-casl-video-to-permission-article
Add CASL Video Link
2 parents f1a15fe + 19b1389 commit 5158127

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

public/articleAssets/2025-11/rbac-vs-abac/abac-diagram.svg

Lines changed: 5 additions & 5 deletions
Loading

src/pages/2025-11/rbac-vs-abac-vs-rebac/index.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,13 @@ const canEdit = isAuthorized({ user, article, action: "edit", environment })
296296

297297
This code is quite a bit more complex than the simple RBAC example, but it scales much better as your authorization logic grows. The `isAuthorized` function just checks to see if there is at least one policy that returns true for the given action and attributes and all the custom logic is handled in the individual policies.
298298

299+
<Tangent>
300+
If you don't like the structure of this code you could use a library like
301+
[CASL](https://casl.js.org/) to define abilities in a more declarative way.
302+
Check out my [full CASL video tutorial](https://youtu.be/gL3BJ8_5Jz8) to learn
303+
more.
304+
</Tangent>
305+
299306
### Benefits of ABAC
300307

301308
This ABAC approach has several major advantages:

0 commit comments

Comments
 (0)