Skip to content
[Experimental] ArangoDB Adapter for Casbin
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.gitignore
.travis.yml
LICENSE
README.md
adapter.go
adapter_test.go
go.mod
go.sum

README.md

ArangoDB Adapter

GoDoc Go Report Card Build Status

ArangoDB Adapter is the Arango DB adapter for Casbin.

TODO

  • Adapter cleanup (closing connections). See this issue.
  • Remove hardcoded db & collection names.
  • Indexes.
  • Filtered policies.
  • Policy removal.
  • Add partial policy removal.
  • Unit tests.
  • Better README (examples of use).

Example

Following snippet of code shows how to initialize adapter and use with casbin enforcer. See documentation for list of all available options.

a, err := arango.NewAdapter(
    arango.OpCollectionName("casbinrules"),
    arango.OpFieldMapping("p", "sub", "obj", "act"))
if err != nil {
    ...
}

e, err := casbin.NewEnforcer("model.conf", a)

...

Contributing

Documentation

Currently this README and examples folder are best source of documentation for this project and of course - source code itself.

Reporting issues

Raise an issue for bugs, enhancements and general discussions/questions about adapter.

Pull requests

If possible each PR should be linked to some issue (except trivial ones like typo fixes). Avoid unrelated changes. Redundant commits should be squashed together before merge.

Getting Help

  • Casbin - main library this adapter is extending

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

You can’t perform that action at this time.