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.1.tar.gz
(17.7 kB
view hashes)
Built Distribution
Close
Hashes for m_abc_anhnt-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc9409d11ab44f1b77e15240701389d8dee7f594e7d6f527b31734e1086f1d08 |
|
MD5 | c0814add4f6b5e2dc01e1d2b2fc25bd5 |
|
BLAKE2b-256 | 52a78877037e7d9ca74c44a7126ea56eadf4b5a51c23b2b29a00fa9b4f3a2a2a |