Support casbin as the authorization backend
Casbin is an authorization library that supports models like ACL, RBAC, ABAC.
Related to RBAC, casbin has several advantages:
- roles can be cascaded, aka roles can have roles.
- support resource roles, so users have their roles and resource have their roles too. role = group here.
- the permission assignments (or policy in casbin's language) can be persisted in files or database (MySQL and Cassandra).
And you can even customize your own access control model, for example, mix RBAC and ABAC together by using roles and attributes at the same time. It's very flexible.
I think it's more powerful than the current ACL way, what do you think? Thanks.
this seems interesting. ideally, with backward compatible configuration, but if it's compelling enough, we can consider full replacement and cutting a v2. as always, providing implementation will speed up adoption :) absent that, you will need to wait until i have spare cycles, of which i have very few (this is essentially a side project for me).
Hi @rojer ,
Thanks for your reply! I have made a PR about adding Casbin authz way: https://github.com/cesanta/docker_auth/pull/182
The original auth way like ACL is a little complicated, like the label. I don't know if I understand it correctly, please advise.
And I have also added the test. In the test I demonstrated the usage of RBAC and admin. So a user can inherit the permissions from a role, and the admin user will have all the permissions to do anything. These show the flexibility of Casbin.
Let me know if there's any question:)