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))
2 files changed
tree: 589457f9b19285ce2c5149ba4962f0d32972a403
  1. .github/
  2. casbin_redis_adapter/
  3. tests/
  4. .gitignore
  5. .releaserc.json
  6. CHANGELOG.md
  7. LICENSE
  8. README.md
  9. requirements.txt
  10. setup.cfg
  11. setup.py
README.md

Redis Adapter for PyCasbin

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

Installation

pip install casbin_redis_adapter

Simple Example

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

Getting Help

License

This project is licensed under the Apache 2.0 license.