Thư viện xử lý kiểm tra quyền theo logic ABAC (Attribute-based access control)
Project description
ABAC Engine
Thư viện xử lý kiểm tra quyền theo logic ABAC (Attribute-based access control).
Cài đặt:
$ pip3 install m-abac
Sử dụng:
3. Save log action account:
from m_abac import PolicyDecisionPoint
merchant_id = "1b99bdcf-d582-4f49-9715-1b61dfff3924"
resource = "deal"
# action = "UpdateFromSale"
action = "ListFromSale"
account_id = "704eac91-7416-497f-a17d-d81cfa2d3211"
user_info = {
"block": "KHDN",
"scope_code": "MB##HN"
}
request_access = {
"deal": {
# "block": "KHCN",
# "scope_code": "MB##HN##CAU_GIAY"
}
}
pdb = PolicyDecisionPoint(merchant_id=merchant_id, resource=resource, action=action, account_id=account_id,
user_info=user_info, request_access=request_access)
result = pdb.is_allowed()
print("allow access: {}".format(result.get_allow_access()))
print("display: {}".format(result.get_display_config()))
print("filter: {}".format(result.get_filter_config()))
Log - 1.0.0
- release sdk
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
m-abc-anhnt-1.0.2.tar.gz
(21.4 kB
view hashes)
Built Distribution
Close
Hashes for m_abc_anhnt-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d367e9ec64622a89dfc9faf099ad200a56253e315581e7b9821483e606850fb |
|
MD5 | a5b6ec6d45a9c772e9aca693ba6a6fce |
|
BLAKE2b-256 | 93243fee62ac2c44114f91a83185ee4fafc4f1d4de23c9500269fb0a8b37f31f |