Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/casbin/cassandra-adapter
Cassandra DB adapter for Casbin
https://github.com/casbin/cassandra-adapter
abac access-control acl adapter authorization casbin rbac storage storage-driver
Last synced: 2 months ago
JSON representation
Cassandra DB adapter for Casbin
- Host: GitHub
- URL: https://github.com/casbin/cassandra-adapter
- Owner: casbin
- License: apache-2.0
- Created: 2017-05-05T04:52:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T14:10:14.000Z (over 1 year ago)
- Last Synced: 2024-10-29T10:08:29.797Z (2 months ago)
- Topics: abac, access-control, acl, adapter, authorization, casbin, rbac, storage, storage-driver
- Language: Go
- Homepage: https://github.com/casbin/casbin
- Size: 15.6 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cassandra Adapter [![Build Status](https://travis-ci.org/casbin/cassandra-adapter.svg?branch=master)](https://travis-ci.org/casbin/cassandra-adapter) [![Coverage Status](https://coveralls.io/repos/github/casbin/cassandra-adapter/badge.svg?branch=master)](https://coveralls.io/github/casbin/cassandra-adapter?branch=master) [![Godoc](https://godoc.org/github.com/casbin/cassandra-adapter?status.svg)](https://godoc.org/github.com/casbin/cassandra-adapter)
====Cassandra Adapter is the [Apache Cassandra DB](http://cassandra.apache.org/) adapter for [Casbin](https://github.com/casbin/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
```go
package mainimport (
"github.com/casbin/casbin"
"github.com/casbin/cassandra-adapter"
)func main() {
// Initialize a Cassandra adapter and use it in a Casbin enforcer:
a := cassandraadapter.NewAdapter("127.0.0.1") // Your Cassandra hosts.
e := casbin.NewEnforcer("examples/rbac_model.conf", a)
// Load the policy from DB.
e.LoadPolicy()
// Check the permission.
e.Enforce("alice", "data1", "read")
// Modify the policy.
// e.AddPolicy(...)
// e.RemovePolicy(...)
// Save the policy back to DB.
e.SavePolicy()
}
```## Getting Help
- [Casbin](https://github.com/casbin/casbin)
## License
This project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.