All Projects → julisch94 → Rqlite Adapter

julisch94 / Rqlite Adapter

Licence: apache-2.0
RQLite adapter for Casbin https://github.com/casbin/casbin

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Rqlite Adapter

Irisadminapi
iris 框架的后台api项目
Stars: ✭ 544 (+240%)
Mutual labels:  casbin
Gin Web
由gin + gorm + jwt + casbin组合实现的RBAC权限管理脚手架Golang版, 搭建完成即可快速、高效投入业务开发
Stars: ✭ 107 (-33.12%)
Mutual labels:  casbin
Rethinkdb Adapter
RethinkDB adapter for Casbin https://github.com/casbin/casbin
Stars: ✭ 148 (-7.5%)
Mutual labels:  casbin
Casbin Example
A Demo App of Attribute-based Access Control in Node.js Based on Casbin.
Stars: ✭ 19 (-88.12%)
Mutual labels:  casbin
Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Golang
Stars: ✭ 10,872 (+6695%)
Mutual labels:  casbin
Node Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.js and Browser
Stars: ✭ 1,757 (+998.13%)
Mutual labels:  casbin
Authz
gin-authz is an authorization middleware for Gin
Stars: ✭ 508 (+217.5%)
Mutual labels:  casbin
Middleware Acl
middleware-acl Access Control Library RBAC casbin
Stars: ✭ 155 (-3.12%)
Mutual labels:  casbin
Jcasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Java
Stars: ✭ 1,335 (+734.38%)
Mutual labels:  casbin
Think Casbin
专为ThinkPHP定制的Casbin的扩展包,Casbin是一个功能强大,高效的开源访问控制库。
Stars: ✭ 138 (-13.75%)
Mutual labels:  casbin
Openstack Policy Editor
A Casbin Policy Editor for OpenStack
Stars: ✭ 28 (-82.5%)
Mutual labels:  casbin
Egg Authz
egg-authz is an authorization middleware for Egg.js based on Casbin
Stars: ✭ 50 (-68.75%)
Mutual labels:  casbin
Zeus
Stars: ✭ 117 (-26.87%)
Mutual labels:  casbin
Pycasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Python
Stars: ✭ 625 (+290.63%)
Mutual labels:  casbin
Negroni Authz
negroni-authz is an authorization middleware for Negroni
Stars: ✭ 152 (-5%)
Mutual labels:  casbin
Casbin.net
An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
Stars: ✭ 535 (+234.38%)
Mutual labels:  casbin
Casbin Cpp
An authorization library that supports access control models like ACL, RBAC, ABAC in C/C++
Stars: ✭ 113 (-29.37%)
Mutual labels:  casbin
Etcd Watcher
Etcd watcher for Casbin
Stars: ✭ 157 (-1.87%)
Mutual labels:  casbin
Think Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in ThinkPHP 6.0 .
Stars: ✭ 155 (-3.12%)
Mutual labels:  casbin
Laravel Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Stars: ✭ 136 (-15%)
Mutual labels:  casbin

RQLite Adapter

GoDoc

This adapter is the RQLite adapter for Casbin. With this library, Casbin can load policies from RQLite databases or save policies to it which will then be distributed over the RQLite cluster.

Installation

go get github.com/edomosystems/rqlite-adapter

Simple Example

package main

import (
  "fmt"
  "github.com/casbin/casbin"
  "github.com/edomosystems/rqlite-adapter"
)

func main() {
  /* Specify the http api url your
  * rqlite node is listening on */
  adapter := rqliteadapter.NewAdapter("http://10.10.40.23:4001")

  enforcer := casbin.NewEnforcer("model.conf", adapter, false)

  enforcer.LoadPolicy()
  enforcer.EnableAutoSave(true)

  enforcer.AddRoleForUser("alice", "admin")
  enforcer.AddRoleForUser("bob", "guest")

  enforcer.AddPermissionForUser("admin", "file", "read")
  enforcer.AddPermissionForUser("admin", "file", "write")
  enforcer.AddPermissionForUser("guest", "file", "read")

  enforcer.Enforce("alice", "file", "read")    // -> True
  enforcer.Enforce("alice", "file", "write")   // -> True
  enforcer.Enforce("bob", "file", "read")      // -> True
  enforcer.Enforce("bob", "file", "write")     // -> False

  /* Simple role hirearchie */
  enforcer.AddRoleForUser("chalie", "interim")
  enforcer.AddRoleForUser("interim", "guest")  // interim inherits from guest

  enforcer.Enforce("charlie", "file", "read")  // -> True
  enforcer.Enforce("charlie", "file", "write") // -> False
}

Getting Help

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].