Skip to content

Commit

Permalink
Merge pull request #11 from hackerchai/master
Browse files Browse the repository at this point in the history
Feat: add get_enforcer() method & bump version 0.3.0
  • Loading branch information
hackerchai authored Jul 21, 2020
2 parents 514adff + 72cde9f commit ba1ff1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-casbin-auth"
version = "0.2.2"
version = "0.3.0"
authors = ["Eason Chai <[email protected]>","Cheng JIANG <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -13,7 +13,7 @@ name = "actix_casbin_auth"
path = "src/lib.rs"

[dependencies]
casbin = { version = "1.1.0", default-features = false, features = ["incremental", "cached"] }
casbin = { version = "1.1.2", default-features = false, features = ["incremental", "cached"] }
tokio = { version = "0.2.21", default-features = false, optional = true }
async-std = { version = "1.6.2", default-features = false, optional = true }
actix-web = "2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion 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.2.2"
actix-casbin-auth = "0.3.0"
actix-rt = "1.1.1"
actix-web = "2.0.0"
```
Expand Down
4 changes: 4 additions & 0 deletions src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ impl CasbinService {
enforcer: Arc::new(RwLock::new(enforcer)),
}
}

pub async fn get_enforcer(&self) -> Arc<RwLock<CachedEnforcer>> {
self.enforcer.clone()
}
}

impl<S, B> Transform<S> for CasbinService
Expand Down

0 comments on commit ba1ff1b

Please sign in to comment.