chore(release): 1.0.0 [skip ci] # 1.0.0 (2023-06-04) ### Features * Add .releaserc.json ([#5](https://github.com/pycasbin/redis-adapter/issues/5)) ([ae2884b](https://github.com/pycasbin/redis-adapter/commit/ae2884b97717e3f7121a3a01fc6780ad51f2b9f6)) * add semantic release ([#3](https://github.com/pycasbin/redis-adapter/issues/3)) ([ba498e5](https://github.com/pycasbin/redis-adapter/commit/ba498e5c520a79d44137ff4ecbbfe1d3ca880b7d)) * complete the redis adapter ([#2](https://github.com/pycasbin/redis-adapter/issues/2)) ([3882922](https://github.com/pycasbin/redis-adapter/commit/38829228a51b3e7e0e88b85e9a7a2a1c5cea3890))
Redis Adapter is the redis adapter for PyCasbin. With this library, Casbin can load policy from redis or save policy to it.
pip install casbin_redis_adapter
import casbin_redis_adapter import casbin adapter = casbin_redis_adapter.Adapter('localhost', 6379) e = casbin.Enforcer('path/to/model.conf', adapter, True) sub = "alice" # the user that wants to access a resource. obj = "data1" # the resource that is going to be accessed. act = "read" # the operation that the user performs on the resource. if e.enforce(sub, obj, act): # permit alice to read data1casbin_sqlalchemy_adapter pass else: # deny the request, show an error pass
This project is licensed under the Apache 2.0 license.