User Management
CITA 实现了基于组的用户管理,组之间为树形的关系,可对应企业的组织结构。
可使用权限管理系统对组进行授权,组内用户除了本身自己的权限之外还拥有所在组的权限。
对于组的管理,用户在拥有系统内置的权限的前提下,还对权限作用的范围做了约束:
- 一个组内的用户可作用于本组及本组所有子组
相对应的鉴权流程增加对组的权限的鉴定,过程如下:
- 对用户的权限进行鉴定
- 对用户所在组的权限进行鉴定
接口说明
操作类接口
name | permissions | parameters | return | describe |
---|---|---|---|---|
newGroup(origin, name, accounts) Create a new group |
newGroup |
origin: The user's origin group
name: The name of the new group accounts: The accounts of the new group |
The address of the new group | A group is a smart contract |
deleteGroup(origin, target) Delete a group |
deleteGroup |
origin: The user's origin group
target: The target group that will be deleted |
true/false | Close the smart contract |
updateGroupName(origin, target, name) Update the group name |
updateGroup |
origin: The user's origin group
target: The target group that will be updated name: The new name of the group |
true/false | None |
addAccounts(origin, target, accounts) Add the group's accounts |
updateGroup |
origin: The user's origin group
target: The target group that will be updated accounts: The accounts will be added |
true/false | None |
deleteAccounts(origin, target, accounts) Delete the group's accounts |
updateGroup |
origin: The user's origin group
target: The target group that will be updated accounts: The accounts will be deleted |
true/false | None |
query
group_management
name | parameters | return | describe |
---|---|---|---|
checkScope(origin, name) Check the target group in the scope of the origin group |
origin: The user's origin group
target: The target group |
true/false | The origin group is ancestor of the target group |
queryGroups() Query all groups |
None | All groups | None |
查询类接口
查询类接口不需要权限。
name | parameters | return | describe |
---|---|---|---|
queryInfo() Query the information of group |
None | Include the name and accounts | None |
queryName() Query the name of group |
None | The name of group | None |
queryAccounts() Query the accounts of group |
None | The accounts of group | None |
queryChild() Query the children of group |
None | The children of group | None |
queryChildLength() Query the number of children |
None | The number of children | None |
queryParent() Query the parent of group |
None | The parent of group | None |
inGroup() Check the user in the group |
None | true/false | None |