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 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.

Release files for casbin-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 casbin-sqlobject-adapter 0.2.0
File Size Uploaded
casbin_sqlobject_adapter-0.2.0.tar.gz 7.9 kB Details

Built distribution (wheel)

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

Total release size: 15.4 kB

Release files / casbin_sqlobject_adapter-0.2.0.tar.gz

Download URL casbin_sqlobject_adapter-0.2.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d79df01693c853a8e7359afd9f337f2b3aee2c5bbf3b438be1d53dd3967cacf1
BLAKE2b-256 checksum
How to use checksums
61d58830bd66bfae8ecd2428354f5daf0471ef8c1f956bf0751190500d7e1264
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

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

Download URL casbin_sqlobject_adapter-0.2.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
521a380e9b796f7f0ffe70074b01c6d83585a6845456ce447d344fee1ffa4ee3
BLAKE2b-256 checksum
How to use checksums
7e25a53eb967a947a427c212fcf411b834fc5fbc690d356d81f83441024c6821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

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