Skip to content

Commit

Permalink
Feat: bump version 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerchai committed Aug 31, 2020
1 parent 9cf7f68 commit bb13c03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-casbin-auth"
version = "0.4.0"
version = "0.4.1"
authors = ["Eason Chai <[email protected]>","Cheng JIANG <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Add it to `Cargo.toml`

```rust
actix-casbin-auth = "0.4.0"
actix-casbin-auth = "0.4.1"
actix-rt = "1.1.1"
actix-web = "2.0.0"
```
Expand Down Expand Up @@ -107,11 +107,21 @@ mod fake_auth;

#[actix_rt::main]
async fn main() -> Result<()> {
let m = DefaultModel::from_file("examples/rbac_restful_keymatch2_model.conf").await?;
let a = FileAdapter::new("examples/rbac_restful_keymatch2_policy.csv"); //You can also use diesel-adapter or sqlx-adapter
let m = DefaultModel::from_file("examples/rbac_with_pattern_model.conf")
.await
.unwrap();
let a = FileAdapter::new("examples/rbac_with_pattern_policy.csv"); //You can also use diesel-adapter or sqlx-adapter

let casbin_middleware = CasbinService::new(m, a).await;

casbin_middleware
.write()
.await
.get_role_manager()
.write()
.unwrap()
.matching_fn(Some(key_match2), None);

HttpServer::new(move || {
App::new()
.wrap(casbin_middleware.clone())
Expand Down

0 comments on commit bb13c03

Please sign in to comment.