Skip to main content

SQLObject Adapter for PyCasbin

Project description

SQLObject Adapter for PyCasbin

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casbin_sqlobject_adapter-0.1.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

casbin_sqlobject_adapter-0.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file casbin_sqlobject_adapter-0.1.1.tar.gz.

File metadata

  • Download URL: casbin_sqlobject_adapter-0.1.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for casbin_sqlobject_adapter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d5f352d79eeae3b5108309866b601935045a72d12d93efb8772704f593a77096
MD5 c7fd537d644b26f8c4ac6e1bfbc68da0
BLAKE2b-256 eecc21ce4d0126d8480144cc767daae42c289fe35dbdb5a4036b48da33ea75b3

See more details on using hashes here.

File details

Details for the file casbin_sqlobject_adapter-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: casbin_sqlobject_adapter-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for casbin_sqlobject_adapter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57ff68a10bab43b6e55998ca83d3e055a2bc34c6ceeefdbaddc5e1673f914a29
MD5 d5b6fd1a2f268ae3ce2157350a990fd7
BLAKE2b-256 21fca2a57828dc21fe545495fe99be71a271b65cd3262d45cf2b904321afb6f3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page