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 sqlobject_adapter
Simple Example
import sqlobject_adapter
import casbin
adapter = 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
File details
Details for the file sqlobject_adapter-0.2.0.tar.gz
.
File metadata
- Download URL: sqlobject_adapter-0.2.0.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510ce603e7e207ba32660f76707a63ecbf5689032df15d42d7c2990b612b7bdf |
|
MD5 | e499c97d546ab7424104d9f4e7f3a381 |
|
BLAKE2b-256 | 334709fe59e00a8e5a5e75cea71e6ec803e067f893858c31fa3e7922c48940d1 |
File details
Details for the file sqlobject_adapter-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: sqlobject_adapter-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18fb1200792090e071e3a63a35e9b8409df5362a9d8eb9d04568825696b4c2f4 |
|
MD5 | dfea795f6c671e5bbcd79490320e6804 |
|
BLAKE2b-256 | bcc789837feffb568e1d54d7feedbd4f6e32d35b59c08e6c81a1e26fcd40235d |