Discover how the Interface Segregation Principle (ISP) keeps your code lean, modular, and maintainable using real-world analogies and practical examples.
<selectedcontent>
element improves dropdowns
is an experimental HTML element that gives developers control over how a selected option is displayed, using just HTML and CSS.
Learn how to implement an advanced caching layer in a Node.js app using Valkey, a high-performance, Redis-compatible in-memory datastore.
Learn how to properly handle rejected promises in TypeScript using Angular, with tips for retry logic, typed results, and avoiding unhandled exceptions.
2 Replies to "How to use AccessControl for RBAC and ABAC in Node.js"
Great post & thank you for sharing, one of the good blogs to read abou tAccessControl for RBAC
I’m glad I found this, thanks Godwin!
Few comments/questions:
– AccessControl was last published in February 2018. Is it still active?
– I was confused until I realized that “post” was a resource and not a route or http method. It would be less confusing if the example resource was “article” or “video.”
– At the beginning it states “A user can have multiple roles” but the example with Express contains “ac.can(req.user.role).readAny(‘post’)”. Can req.user.role be an array of roles?
– There is a JSON typo: ‘read:any’: [‘*’, ‘!id]