KO
|
EN
gitlite — search
Search
#javascript
#java
#python
#react
#cpp
#nodejs
#typescript
#machine-learning
#hacktoberfest
#go
#python3
#flask
pymongo-adapter
★ 10
Open GitHub ↗
PyMongo Adapter for PyCasbin
Download README (.md)
Explore Similar Repositories
django-authorization
:
Per object permissions for Django, see example at: https://github.com/pycasbin/django-authorization-example
django-orm-adapter
:
Django ORM Adapter for PyCasbin
casbin-python-fastapi-casbin-auth
:
FastAPI authorization middleware based on PyCasbin
casbin-tortoise-adapter
:
A Casbin <=> Tortoise ORM dynamic policy adapter for PyCasbin
async-sqlalchemy-adapter
:
Async SQLAlchemy Adapter for PyCasbin
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
pymongo-adapter
?
Download (.md)
PyMongo Adapter for PyCasbin ==== [](https://www.travis-ci.org/pycasbin/pymongo-adapter) [](https://coveralls.io/github/pycasbin/pymongo-adapter) [](https://pypi.org/project/casbin_pymongo_adapter/) [](https://pypi.org/project/casbin_pymongo_adapter/) [](https://pypi.org/project/casbin_pymongo_adapter/) [](https://pypi.org/project/casbin_pymongo_adapter/) [](https://pypi.org/project/casbin_pymongo_adapter/) PyMongo Adapter is the [PyMongo](https://pypi.org/project/pymongo/) adapter for [PyCasbin](https://github.com/casbin/pycasbin). With this library, Casbin can load policy from MongoDB or save policy to it. ## Installation ``` pip install casbin_pymongo_adapter ``` ## Simple Example ```python import casbin_pymongo_adapter import casbin adapter = casbin_pymongo_adapter.Adapter('mongodb://localhost:27017/', "dbname") 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 - [PyCasbin](https://github.com/casbin/pycasbin) ### License This project is licensed under the [Apache 2.0 license](LICENSE).