From 96ba631073ff130367455fa22631b3a7cbd16b84 Mon Sep 17 00:00:00 2001 From: Hackerchai Date: Mon, 31 Aug 2020 19:12:02 +0800 Subject: [PATCH 1/2] Feat: upgrade casbin v2 --- Cargo.toml | 4 ++-- src/casbin_actor.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 44f1bd9..4ad9e5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,8 @@ path = "src/lib.rs" [dependencies] actix = "0.9.0" -casbin = { version = "1.1.3", default-features = false, features = [ "incremental", "cached"] } -actix-casbin-auth = { version = "0.3.2", default-features = false } +casbin = { version = "2.0.1", default-features = false, features = [ "incremental", "cached"] } +actix-casbin-auth = { version = "0.4.0", default-features = false } tokio = { version = "0.2.22", default-features = false, optional = true } async-std = { version = "1.6.3", default-features = false, optional = true } futures = "0.3" diff --git a/src/casbin_actor.rs b/src/casbin_actor.rs index c082cde..d7bb012 100644 --- a/src/casbin_actor.rs +++ b/src/casbin_actor.rs @@ -122,7 +122,7 @@ impl Handler for CasbinActor { async move { let mut lock = cloned_enforcer.write().await; let result = match msg { - CasbinCmd::Enforce(policy) => lock.enforce(&policy).map(CasbinResult::Enforce), + CasbinCmd::Enforce(policy) => lock.enforce(policy).map(CasbinResult::Enforce), CasbinCmd::AddPolicy(policy) => { lock.add_policy(policy).await.map(CasbinResult::AddPolicy) } From 1163a703a382914328fdd6245a05ef58e5d8b357 Mon Sep 17 00:00:00 2001 From: Hackerchai Date: Mon, 31 Aug 2020 19:12:51 +0800 Subject: [PATCH 2/2] Feat: bump version 0.4.0 --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4ad9e5c..1e12c10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-casbin" -version = "0.3.3" +version = "0.4.0" authors = ["Eason Chai ","Cheng JIANG "] edition = "2018" license = "Apache-2.0" diff --git a/README.md b/README.md index a53478d..2068bdb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add it to `Cargo.toml` ```rust -actix-casbin = "0.3.3" +actix-casbin = "0.4.0" actix-rt = "1.1.1" ```