Skip to content

abqadeer/python-dycasbin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

dynamodb adopter for casbin in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages