All Projects → casbin → Redis Adapter

casbin / Redis Adapter

Licence: apache-2.0
Redis adapter for Casbin

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Redis Adapter

Gorm Adapter
Gorm adapter for Casbin
Stars: ✭ 373 (+123.35%)
Mutual labels:  adapter, authorization, auth, access-control, casbin
sequelize-adapter
Sequelize adapter for Casbin
Stars: ✭ 51 (-69.46%)
Mutual labels:  adapter, auth, authorization, access-control, casbin
Casbin Rs
An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
Stars: ✭ 375 (+124.55%)
Mutual labels:  authorization, auth, access-control, casbin
Mongodb Adapter
MongoDB adapter for Casbin
Stars: ✭ 194 (+16.17%)
Mutual labels:  adapter, authorization, access-control, casbin
Casbin.net
An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
Stars: ✭ 535 (+220.36%)
Mutual labels:  authorization, auth, access-control, casbin
Xorm Adapter
Xorm adapter for Casbin
Stars: ✭ 329 (+97.01%)
Mutual labels:  adapter, authorization, access-control, casbin
lua-casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Lua (OpenResty)
Stars: ✭ 43 (-74.25%)
Mutual labels:  auth, authorization, access-control, casbin
Pycasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Python
Stars: ✭ 625 (+274.25%)
Mutual labels:  authorization, auth, access-control, casbin
sqlx-adapter
Asynchronous casbin adapter for mysql, postgres, sqlite based on sqlx-rs
Stars: ✭ 27 (-83.83%)
Mutual labels:  adapter, auth, access-control, casbin
Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Golang
Stars: ✭ 10,872 (+6410.18%)
Mutual labels:  authorization, auth, access-control, casbin
casbin-ex
An authorization library that supports access control models like ACL, RBAC, ABAC in Elixir
Stars: ✭ 37 (-77.84%)
Mutual labels:  auth, authorization, access-control, casbin
Node Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.js and Browser
Stars: ✭ 1,757 (+952.1%)
Mutual labels:  authorization, auth, access-control, casbin
Protobuf Adapter
Google Protocol Buffers adapter for Casbin
Stars: ✭ 185 (+10.78%)
Mutual labels:  adapter, authorization, access-control, casbin
Openstack Policy Editor
A Casbin Policy Editor for OpenStack
Stars: ✭ 28 (-83.23%)
Mutual labels:  authorization, auth, access-control, casbin
dart-casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Dart/Flutter
Stars: ✭ 30 (-82.04%)
Mutual labels:  auth, authorization, access-control, casbin
Casbin4D
An authorization library that supports access control models like ACL, RBAC, ABAC in Delphi
Stars: ✭ 25 (-85.03%)
Mutual labels:  auth, authorization, access-control, casbin
Jcasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Java
Stars: ✭ 1,335 (+699.4%)
Mutual labels:  authorization, auth, access-control, casbin
Casbin Cpp
An authorization library that supports access control models like ACL, RBAC, ABAC in C/C++
Stars: ✭ 113 (-32.34%)
Mutual labels:  authorization, access-control, casbin
Awesome Auth
📊 Software and Libraries for Authentication & Authorization
Stars: ✭ 520 (+211.38%)
Mutual labels:  authorization, auth, access-control
jdbc-adapter
JDBC adapter for Casbin
Stars: ✭ 26 (-84.43%)
Mutual labels:  adapter, authorization, access-control

Redis Adapter Build Status Coverage Status Godoc

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

Installation

go get github.com/casbin/redis-adapter

Simple Example

package main

import (
	"github.com/casbin/casbin/v2"
	"github.com/casbin/redis-adapter/v2"
)

func main() {
	// Initialize a Redis adapter and use it in a Casbin enforcer:
	a := redisadapter.NewAdapter("tcp", "127.0.0.1:6379") // Your Redis network and address.
	// Use the following if Redis has password like "123"
    //a := redisadapter.NewAdapterWithPassword("tcp", "127.0.0.1:6379", "123")
	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

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].