arkid_client.perm.
PermClient
(base_url, authorizer=None, **kwargs)[源代码]¶基类:arkid_client.base.BaseClient
权限管理客户端, 用于与 ArkID 服务端权限管理相关接口的访问操作。
Methods
query_all_perm()
create_perm()
query_perm()
update_perm()
query_perm_owner()
update_perm_owner()
query_specified_user_perm()
update_specified_user_perm()
query_dept_perm()
update_dept_perm()
query_group_perm()
update_group_perm()
query_node_perm()
update_node_perm()
query_all_perm
()[源代码]¶获取所有权限
(GET /siteapi/v1/perm/
)
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_perm()
>>> print('perm is', perm)
create_perm
(json_body: dict)[源代码]¶创建权限
(POST /siteapi/v1/perm/
)
Parameters:
json_body
(dict)
scope
(str)- 应用
uid
name
(str)- 应用名称
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = uc.create_perm(...)
>>> print('perm is', perm)
query_perm
(uid: str)[源代码]¶获取指定权限
(GET /siteapi/v1/perm/<uid>/
)
Parameters:
uid
(str)- 权限唯一标识
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_perm(...)
>>> print('perm is', perm)
update_perm
(uid: str, json_body: dict)[源代码]¶更新指定权限
(PATCH /siteapi/v1/perm/<uid>/
)
Parameters:
uid
(str)- 权限唯一标识
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.update_perm(...)
>>> print('perm is', perm)
query_perm_owner
(uid: str, **params)[源代码]¶获取某权限指定类型的所有者
该接口内的 uid
,对于 user
为 username
,对于 node
为 node_uid
(GET /siteapi/v1/perm/<uid>/
)
Parameters:
uid
(str)- 权限唯一标识
owner_subject
(str)- 权限所有者类型
value
(bool)- 最终判定结果
status
(int)- 授权状态
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_perm_owner(...)
>>> print('perm is', perm)
External Documentation
关于 params 参数 详情请参阅API文档。
update_perm_owner
(uid: str, **params)[源代码]¶更新某权限指定类型的所有者,仅按提供的数据做局部修改
该接口内的 uid
,对于 user
为 username
,对于 node
为 node_uid
(PATCH /siteapi/v1/perm/<uid>/
)
Parameters:
uid
(str)- 权限唯一标识
owner_subject
(str)- 权限所有者类型
value
(bool)- 最终判定结果
status
(int)- 授权状态
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.update_perm_owner(...)
>>> print('perm is', perm)
External Documentation
关于 params 参数 详情请参阅API文档。
query_specified_user_perm
(username: str, **params)[源代码]¶获取用户所有权限,包括所有授权、未授权的权限
(GET /siteapi/v1/perm/user/<username>/
)
Parameters:
username
(str)- 用户唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_specified_user_perm(...)
>>> print('perm is', perm)
update_specified_user_perm
(username: str, json_body: dict)[源代码]¶更新用户权限
(PATCH /siteapi/v1/perm/user/<username>/
)
Parameters:
username
(str)- 用户唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
json_body
(int)- 权限的部分元信息,详见接口文档
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.update_specified_user_perm(...)
>>> print('perm is', perm)
External Documentation
关于 权限的元数据 详情请参阅API文档。
query_dept_perm
(uid: str, **params)[源代码]¶获取部门所有权限,包括所有授权、未授权的权限
(GET /siteapi/v1/perm/dept/<uid>/
)
Parameters:
uid
(str)- 部门唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_dept_perm(...)
>>> print('perm is', perm)
update_dept_perm
(uid: str, json_body: dict)[源代码]¶获取部门所有权限,包括所有授权、未授权的权限
(PATCH /siteapi/v1/perm/dept/<uid>/
)
Parameters:
uid
(str)- 部门唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
json_body
(dict)- 权限的元信息,详情参见接口文档
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.update_dept_perm(...)
>>> print('perm is', perm)
query_group_perm
(uid: str, **params)[源代码]¶获取组所有权限,包括所有授权、未授权的权限
(GET /siteapi/v1/perm/group/<uid>/
)
Parameters:
uid
(str)- 组的唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_group_perm(...)
>>> print('perm is', perm)
update_group_perm
(uid: str, json_body: dict)[源代码]¶获取组所有权限,包括所有授权、未授权的权限
(PATCH /siteapi/v1/perm/group/<uid>/
)
Parameters:
uid
(str)- 组唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
json_body
(dict)- 权限的元信息,详情参见接口文档
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.update_group_perm(...)
>>> print('perm is', perm)
query_node_perm
(node_uid: str, **params)[源代码]¶获取节点所有权限,包括所有授权、未授权的权限
(GET /siteapi/v1/perm/node/<uid>/
)
Parameters:
node_uid
(str)- 节点的唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.query_node_perm(...)
>>> print('perm is', perm)
update_node_perm
(node_uid: str, json_body: dict)[源代码]¶获取组所有权限,包括所有授权、未授权的权限
(PATCH /siteapi/v1/perm/node/<uid>/
)
Parameters:
node_uid
(str)- 节点的唯一标识
action
(str)- 特定操作
action_except
(bool)- 排除某操作,惯用``action_except=access``获取应用内权限
scope
(int)- 与应用``uid``对应,惯用该字段获取某应用下权限
json_body
(dict)- 权限的元信息,详情参见接口文档
Examples
>>> pc = arkid_client.PermClient(...)
>>> perm = pc.update_node_perm(...)
>>> print('perm is', perm)