https://github.com/casbin-rs/casbin-rust-cli
Rust CLI for Casbin-RS
https://github.com/casbin-rs/casbin-rust-cli
abac acl auth authorization authz casbin casbin-rs cli client permission rbac rust sdk
Last synced: over 1 year ago
JSON representation
Rust CLI for Casbin-RS
- Host: GitHub
- URL: https://github.com/casbin-rs/casbin-rust-cli
- Owner: casbin-rs
- License: apache-2.0
- Created: 2025-01-17T14:43:53.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-04T16:42:14.000Z (over 1 year ago)
- Last Synced: 2025-03-07T01:46:11.104Z (over 1 year ago)
- Topics: abac, acl, auth, authorization, authz, casbin, casbin-rs, cli, client, permission, rbac, rust, sdk
- Language: Rust
- Homepage: https://github.com/casbin/casbin-rs
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# casbin-rust-cli
[](https://crates.io/crates/casbin-rust-cli)
[](https://docs.rs/casbin-rust-cli)
[](https://github.com/casbin-rs/casbin-rust-cli/actions/workflows/ci.yml)
casbin-rust-cli is a command-line tool based on Casbin (Rust language), enabling you to use all of Casbin APIs in the shell.
## Installation
### From crates.io
```shell
cargo install --locked casbin-rust-cli
```
### Install Manually
```shell
git clone https://github.com/casbin-rs/casbin-rust-cli.git
cd casbin-rust-cli
cargo install --path .
```
## Options
| options | description | must |
|----------------|----------------------------------------------|------|
| `-m, --model` | The path of the model file or model text | y |
| `-p, --policy` | The path of the policy file or policy text | y |
| `enforce` | Check permissions | n |
## Get started
- Check whether Alice has read permission on data1
```shell
./casbin-rust-cli enforce -m "examples/basic_model.conf" -p "examples/basic_policy.csv" "alice" "data1" "read"
```
> {"allow":true,"explain":[]}