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.4.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_dycasbin-0.4.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_dycasbin-0.4.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for python_dycasbin-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d11bf7e86a9e661b454f3b585e8622c31a905dc474b6a213d7bec8a05043622e
MD5 ce1fd563ff344539291431376c9731ee
BLAKE2b-256 6ff30d6e927c0f88932bb97080c0d094a04595cfbc8734983d1cf92824e1c08b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_dycasbin-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for python_dycasbin-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b70ab71f8a1301d7a8ebd88f03ae93c0ef0b5139e88780d4f75fbd7ba088a1
MD5 9ceb6fa3e0af777851123240fdb7bcab
BLAKE2b-256 8cd155252a426c977f93f60bda609b5d28a7b6f5453eaef3a4565a2fa26e93fc

See more details on using hashes here.

Supported by

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