YAML Adapter for Casbin-RS

Clone this repo:

Branches

  1. 705a49b docs: fix broken links (#6) by YunShu · 2 years, 1 month ago master
  2. 3cf558e feat: bump version to 1.0.0 by Yang Luo · 2 years, 1 month ago v1.0.0
  3. 816fa7b feat: add semantic-release (#8) by 沐 · 2 years, 1 month ago
  4. e88f91e fix: build errors (#9) by 沐 · 2 years, 1 month ago
  5. 402acae Remove travis script by Yang Luo · 2 years, 2 months ago

yaml-adapter

crates docs download ci

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

Dependency

Add following to Cargo.toml

yaml-adapter = { version = "1.0.0", features = "runtime-async-std" }
async-std = "1.5.0"

for using tokio

yaml-adapter = { version = "1.0.0", features = "runtime-tokio" }
tokio = "0.3.1"

Examples

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

for policy file configuration, please refer to example