Group the imports.
2 files changed
tree: cbead8562299a37a46cbdd765d2d0a6ceb4dfe26
  1. examples/
  2. .gitignore
  3. adapter.go
  4. adapter_test.go
  5. LICENSE
  6. README.md
README.md

Cassandra Adapter for Casbin Godoc

Cassandra Adapter is the Apache Cassandra DB adapter for Casbin. With this library, Casbin can load policy from Cassandra or save policy to it.

Installation

go get github.com/casbin/cassandra_adapter

Simple Example

package main

import (
	"github.com/casbin/casbin"
	"github.com/casbin/cassandra_adapter"
)

func main() {
	// Initialize a Cassandra adapter and use it in a Casbin enforcer:
	a := cassandra_adapter.NewAdapter("192.168.41.130") // Your Cassandra hosts. 
	e := casbin.NewEnforcer("examples/rbac_model.conf", a)
	
	e.Enforce("alice", "data1", "read")
}

Getting Help

License

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