Fibase Adapter for PyCasbin
Project description
Firebase Adapter for PyCasbin
Firebase Adapter is the Firebase adapter for PyCasbin. With this library, Casbin can load policy from Firebase Firestore or save policy to it.
Installation
pip install pycasbin_firebase_adapter
Simple Example
import pycasbin_firebase_adapter
import casbin
adapter = pycasbin_firebase_adapter.Adapter('path/to/services.json')
e = casbin.Enforcer('path/to/model.conf', adapter)
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
Credits
Based on sqlalchemy-adapter
Getting Help
License
This project is licensed under the Apache 2.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pycasbin_firebase_adapter-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66b5b3de3481871d37e55ebda027fba009994efb1567c45cd4793919e4269c2c |
|
MD5 | e525eba4136de39434bb55efc26342a1 |
|
BLAKE2b-256 | 181c0e748c3952f650f7ff74f8d8079ebdda27a2a6f322b0256858f749abbf24 |
Close
Hashes for pycasbin_firebase_adapter-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faf08563d9016a30f85f863650c01c036c415ec12f5e229f68843fb66a2480c1 |
|
MD5 | 7efd75de91dcea246cc015be9a079492 |
|
BLAKE2b-256 | a54817ddfcd2fd8df9c9bcc98646bebc4734c5251f9e6f5dd4d1d6056853a5e5 |