Skip to main content

SQLObject Adapter for PyCasbin

GitHub Action Coverage Status Version PyPI - Wheel Pyversions Download License

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.

Metadata

Release files for sqlobject-adapter 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlobject-adapter 0.2.0
File Size Uploaded
sqlobject_adapter-0.2.0.tar.gz 4.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlobject-adapter 0.2.0
File Interpreter ABI Platform
sqlobject_adapter-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 MB

Release files / sqlobject_adapter-0.2.0.tar.gz

Download URL sqlobject_adapter-0.2.0.tar.gz
Size 4.2 MB
Tags Source
SHA-256 checksum
How to use checksums
510ce603e7e207ba32660f76707a63ecbf5689032df15d42d7c2990b612b7bdf
BLAKE2b-256 checksum
How to use checksums
334709fe59e00a8e5a5e75cea71e6ec803e067f893858c31fa3e7922c48940d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / sqlobject_adapter-0.2.0-py3-none-any.whl

Download URL sqlobject_adapter-0.2.0-py3-none-any.whl
Size 5.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
18fb1200792090e071e3a63a35e9b8409df5362a9d8eb9d04568825696b4c2f4
BLAKE2b-256 checksum
How to use checksums
bcc789837feffb568e1d54d7feedbd4f6e32d35b59c08e6c81a1e26fcd40235d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page