casbin / casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
https://casbin.org
Apache License 2.0
828 stars 67 forks source link

Start to make examples #64

Open GopherJ opened 4 years ago

GopherJ commented 4 years ago

It'll help the developpers a lot if we can add more examples like what actix-web has done: https://github.com/actix/examples

Currently we don't have enough docs. I hope me or anyone else can find time to add them.

But at the same time we can already start to prepare some examples like:

  1. actix-web + casbin example with fileadapter
  2. actix-web + casbin example with diesel-adapter
  3. actix-web + casbin example using CachedEnforcer (default cache) ...

Maybe we can also add some examples on other web frameworks.

I added an repo if anyone wants to contribute.

https://github.com/casbin-rs/examples

omid commented 4 years ago

I've already started the second option. It's not finished, since I faced some problems in the diesel-adapter. After releasing version 0.3.0 it's more possible to be able to finalize it.

GopherJ commented 4 years ago

@omid don't hesitate if you have met any problems.

omid commented 4 years ago

@GopherJ PR is created @ https://github.com/casbin-rs/examples/pull/2

hackerchai commented 4 years ago

actix-web + casbin example with diesel-adapter, using CachedEnforcer https://github.com/casbin-rs/examples/tree/master/actix-middleware-example