Skip to main content

DynamoDB adopter for casbin

Project description

DynamoDB adopter for casbin

Installation

Run pip install python-dycasbin

Usage

import casbin
from python_dycasbin import adapter

adapter = adapter.Adapter(table_name='casbin_rule', endpoint_url='http://localhost:8000')
e = casbin.Enforcer("model.conf", adapter, True)

sub = "eve4"  # the user that wants to access a resource.
obj = "data3"  # 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):
    print("Allow")
else:
    print("Deny")

Running tests

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

python_dycasbin-0.3.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

python_dycasbin-0.3.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file python_dycasbin-0.3.1.tar.gz.

File metadata

  • Download URL: python_dycasbin-0.3.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for python_dycasbin-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e3aaed13e608e58b105cf36b523fc883ec64ed01aec4cdfba42a4fff5669b2b3
MD5 01670cf3736db4f3f919d1275180ae83
BLAKE2b-256 15026cd8427f257fc2c7d48f3889806288bca13df2ef70376806ecc420c47580

See more details on using hashes here.

File details

Details for the file python_dycasbin-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: python_dycasbin-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for python_dycasbin-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c24eb5609579b0b6331c829035b071663be521cccb1f1d8dd5ccd7d0adc6b99
MD5 524726ca97070b0bf0b3352dd55ebf2e
BLAKE2b-256 fc771d1460c0f01826bb6399969efc4df436b6f4df3f43ff6a32f936c8548e5c

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