diff --git a/casbin/Cargo.toml b/casbin/Cargo.toml index 0c4ee816..d35661fd 100644 --- a/casbin/Cargo.toml +++ b/casbin/Cargo.toml @@ -7,6 +7,6 @@ workspace = ".." [dependencies] actix-web = "2.0" -actix-rt = "1.0" -casbin = "0.4" -loge = { version = "0.4", default-features = false, features = ["colored", "chrono"] } +actix-rt = "1.1.0" +casbin = "0.6.0" +loge = {version = "0.4", default-features = false, features = ["colored", "chrono"]} diff --git a/casbin/README.md b/casbin/README.md index 752ef2a9..198042ac 100644 --- a/casbin/README.md +++ b/casbin/README.md @@ -23,5 +23,4 @@ In this example, you can get the the successful result at `http://localhost:8080 ## Others -- Original location of this demo: - For more related examples of [Casbin-RS](https://github.com/casbin/casbin-rs): diff --git a/casbin/src/main.rs b/casbin/src/main.rs index 3ae6bfb9..2394ffa6 100644 --- a/casbin/src/main.rs +++ b/casbin/src/main.rs @@ -1,5 +1,4 @@ -use casbin::{DefaultModel, Enforcer, FileAdapter, RbacApi}; -use std::boxed::Box; +use casbin::{CoreApi, DefaultModel, Enforcer, FileAdapter, RbacApi}; use std::io; use std::sync::RwLock; @@ -37,9 +36,7 @@ async fn main() -> io::Result<()> { .unwrap(); let adapter = FileAdapter::new("rbac/rbac_policy.csv"); - let e = Enforcer::new(Box::new(model), Box::new(adapter)) - .await - .unwrap(); + let e = Enforcer::new(model, adapter).await.unwrap(); let e = web::Data::new(RwLock::new(e)); // wrap enforcer into actix-state //move is necessary to give closure below ownership of counter