CASL is a library for managing permissions across applications. It allows defining permissions declaratively using rules. Rules can be defined for different user roles, like "admin" or "writer", and permissions are validated both in memory and for database queries. CASL aims to provide a flexible yet simple way to manage permissions as requirements evolve. It supports features like tree shaking, instance and attribute validation, and database queries.
2. Who am I and what I do here?
Experience:
● working from dark times of IE6
● PHP, Ruby, Nodejs, ~Java and .NET Core
Hobbies:
● chess, books
● articles , open source contribution
12. How to CASL
Evolve ACL as requirements evolve1
What’s special in CASL?
Declarative configuration2
In-memory validation and database queries3
MongoDB-like conditions4
Serializable rules5
15. How to CASLPermissions: writer
can create Article
can read Article
where published = true
can read, update Article
where author = me
can delete, publish Article
where author = me and published = false
can read, update User
where id = me
29. Downloads
/ month
Github
stars
Size
(gzip)
Last updated Tree
shaking
Instance
validation
Attribute
validation
DB
Queries
@casl/ability 105k 1.6k 3.9K 2 weeks ago Yes Yes Yes Yes
acl 31k 2.3k 56.6K 2 years ago No No No No
accesscontrol 44k 965 7.7K 10 months ago Maybe No Yes No
connect-roles 20k 704 5.2K 9 months ago No No No No
casbin 16k 670 34.6K 2 months ago Maybe Yes Yes No
cancan 1.7k 578 985 1 year ago No Yes No No
How to CASLCASL Alternatives