SQLObject Adapter for PyCasbin
Project description
SQLObject Adapter for PyCasbin
SQLObject Adapter is the SQLObject adapter for PyCasbin. With this library, Casbin can load policy from SQLObject supported database or save policy to it.
The current supported databases are:
- PostgreSQL
- MySQL
- SQLite
- Microsoft SQL Server
- Firebird
- Sybase
- MAX DB
- pyfirebirdsql
Installation
pip install casbin_sqlobject_adapter
Simple Example
import casbin_sqlobject_adapter
import casbin
adapter = casbin_sqlobject_adapter.Adapter('sqlite:///test.db')
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for casbin_sqlobject_adapter-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5f352d79eeae3b5108309866b601935045a72d12d93efb8772704f593a77096 |
|
MD5 | c7fd537d644b26f8c4ac6e1bfbc68da0 |
|
BLAKE2b-256 | eecc21ce4d0126d8480144cc767daae42c289fe35dbdb5a4036b48da33ea75b3 |
Close
Hashes for casbin_sqlobject_adapter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57ff68a10bab43b6e55998ca83d3e055a2bc34c6ceeefdbaddc5e1673f914a29 |
|
MD5 | d5b6fd1a2f268ae3ce2157350a990fd7 |
|
BLAKE2b-256 | 21fca2a57828dc21fe545495fe99be71a271b65cd3262d45cf2b904321afb6f3 |