Skip to content
Cassandra DB adapter for Casbin
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Add the adapter code and related test. May 5, 2017
.gitignore Ignore IDEA files. May 5, 2017
.travis.yml Configure Cassandra provided by Travis CI. Jun 12, 2017
LICENSE Initial commit May 5, 2017 Fix wrong package name in Readme Jun 22, 2017
adapter.go Add empty auto-save functions. Jul 22, 2017

Cassandra Adapter Build Status Coverage Status 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.


go get

Simple Example

package main

import (

func main() {
	// Initialize a Cassandra adapter and use it in a Casbin enforcer:
	a := cassandraadapter.NewAdapter("") // Your Cassandra hosts. 
	e := casbin.NewEnforcer("examples/rbac_model.conf", a)
	// Load the policy from DB.
	// Check the permission.
	e.Enforce("alice", "data1", "read")
	// Modify the policy.
	// e.AddPolicy(...)
	// e.RemovePolicy(...)
	// Save the policy back to DB.

Getting Help


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.