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.0.tar.gz
(17.6 kB
view hashes)
Built Distribution
Close
Hashes for m_abc_anhnt-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 656c6eb1a20c03d2c186e5078711efae9bee937566f1d00cd9ffecc267a445cd |
|
MD5 | 0334e931c99119f1837aba6a9f00e650 |
|
BLAKE2b-256 | ccd2d1c5fe67146836e8dd0287080ce01127b8969ce3a9ec3d7e6ddad804750e |