JSON Adapter for Casbin-RS

Clone this repo:
  1. 3fe00ab Merge pull request #2 from smrpn/badges by Yang Luo · 4 years, 8 months ago main
  2. 78c708b ft: add codecov badge by smrpn · 4 years, 8 months ago
  3. 3172361 ft: add ci badge and codecov integration by smrpn · 4 years, 8 months ago
  4. daafb8c add test for tokio and async-std by smrpn · 5 years ago
  5. 299339f add test for tokio and async-std by smrpn · 5 years ago

json-adapter

CI codecov

Json Adapter is a json adapter for Casbin-rs. With this library, Casbin can load policy from json format file or save policy into it with fully asynchronous support.

Dependency

Add following to Cargo.toml

json-adapter = { version = "0.1.0", features = "runtime-async-std" }
async-std = "1.6.4"

for using tokio

json-adapter = { version = "0.1.0", features = "runtime-tokio" }
tokio = "1.2.0"

Examples

let adapter = JsonAdapter::new("examples/rbac_policy.json");
let e = Enforcer::new(m, adapter).await.unwrap();

for policy file configuration, please refer to example