Improve README badges.
1 file changed
tree: 8b53280b948c99de1041a92f72b7237b76e21852
  1. .github/
  2. examples/
  3. .gitignore
  4. .releaserc.json
  5. authz.go
  6. authz_test.go
  7. go.mod
  8. go.sum
  9. LICENSE
  10. README.md
README.md

graphql-authz

Coverage Status Go Release Go Report Card

graphql-authz is a casbin binding of graphql, something like restful api. There're actions, like enforce, getPolicies, addPolicy, removePolicy, updatePolicy.

Install

go get -u github.com/casbin/graphql-authz

Usage

Enforce Example:

e, _ := casbin.NewEnforcer("./examples/model.conf", "./examples/policy.csv")
schema := authz.InitType(e)
result := authz.Execute(`{enforce(sub:"alice" obj:"data1" act:"read"){sub obj act ok}}`, schema)

More info, please refer to graphql and basic usage