最近更新时间:2023.05.22 19:35:19
首次发布时间:2022.05.25 20:51:38
本文档提供 LAS 中 权限管理 相关的 OpenAPI,具体包含:
OpenAPI 调用方式可参考 API 调用指南
API Version 统一为 2021-07-01
根据指定的队列,获取具有其权限的用户/用户组列表。
请求方式:GET
Action:ListAuthorizedPrincipalsForQueue
Params:
参数 | 是否必须 | 描述 |
---|---|---|
QueueName | Y | 队列名 |
IdentityName | N | 过滤项:用户/组名关键词搜索,精确匹配 |
IdentityType | N | 过滤项:用户类型,可选项为:User/Group。如果多选,则逗号分隔,如 xxx,yyy |
Role | N | 过滤项:角色,可选项为:Admin/Viewer/Developer。如果多选,则逗号分隔,如 xxx,yyy |
Limit | Y | 这个是每页能够显示的最大数量 |
Offset | Y | 最小值为 1,代表页数 |
DataTypes.DataList<DataTypes.AuthorizedPrincipal>
根据用户名模糊查询用户列表,同时判断用户是否已经具有指定队列的权限。
请求方式:GET
Action:ListIAMUsersWithQueueRole
Params:
参数 | 是否必须 | 描述 |
---|---|---|
IdentityName | Y | 用户名,支持模糊查询 |
QueueName | Y | 队列名 |
Limit | Y | 这个是每页能够显示的最大数量 |
Offset | Y | 最小值为 1,代表页数 |
DataTypes.DataList<DataTypes.IAMUserWithRole>
为用户授予指定数据对象的权限。
请求方式:POST
Action:GrantQueuePrivilege
Body:
参数 | 类型 | 是否必须 | 描述 |
---|---|---|---|
AccountID | String | N | 用户 AccountID,默认为当前用户 AccountID |
QueueName | String | Y | 队列名,e.g.: “公共队列” |
Role | String | Y | 角色(对数据对象的操作权限),可选项为:Admin/Viewer/Developer |
IdentityList | Array | Y | 用户信息数组 |
IdentityList.IdentityId | String | Y | 用户/组 ID |
IdentityList.IdentityType | String | Y | 用户类型:User/Group |
{ "IdentityList": [ { "IdentityType": "User", "IdentityId": "xxxx" } ], "QueueName": "公共队列", "Role": "Developer" }
回收用户对指定队列的权限。
请求方式:POST
Action:RevokeQueuePrivilege
Body:
参数 | 类型 | 是否必须 | 描述 |
---|---|---|---|
AccountId | String | N | 用户所属租户的 AccountID,默认为当前用户 AccountID |
QueueName | String | Y | 队列名 |
Role | String | Y | 角色:Admin/Viewer/Developer |
IdentityList | Array | Y | 用户信息数组 |
IdentityList.IdentityId | String | Y | 用户/组 ID |
IdentityList.IdentityType | String | Y | 用户类型:User/Group |
修改用户对指定队列的权限。实际效果可以简单理解为:先对老的权限 RevokeQueuePrivilege,然后再对新的权限 GrantQueuePrivilege 。
请求方式:POST
Action:AlterQueuePrivilege
Body:
参数 | 类型 | 是否必须 | 描述 |
---|---|---|---|
AccountID | String | N | 用户 AccountID,默认为当前用户 AccountID |
QueueName | String | Y | 队列名 |
OldRole | String | Y | 老角色(对数据对象的操作权限),可选项为:Admin/Viewer/Developer |
Role | String | Y | 角色(对数据对象的操作权限),可选项为:Admin/Viewer/Developer |
IdentityList | Array | Y | 用户信息数组 |
IdentityList.IdentityId | String | Y | 用户/组 ID |
IdentityList.IdentityType | String | Y | 用户类型:User/Group |
包含 库表、UDF、资源 三部分权限的管理
根据指定的数据对象,获取具有其权限的用户/用户组列表。
请求方式:GET
Action:ListPrincipalsForDataObject
Params:
参数 | 是否必须 | 描述 |
---|---|---|
DataObjectScope | Y | 指定不同层级的对象,可选项为:Schema/Table/UDF/Resource |
SchemaName | Y | Schema Name |
DataObjectName | N | DataObject Name,如果 Scope 为 Schema,则此项为空 |
IdentityName | N | 过滤项:用户/组名关键词搜索,精确匹配 |
IdentityType | N | 过滤项:用户类型,可选项为:User/Group/GroupDataLeap。如果多选,则逗号分隔,如 xxx,yyy |
Role | N | 过滤项:角色,可选项为:Admin/Viewer/Developer。如果多选,则逗号分隔,如 xxx,yyy |
Limit | Y | 这个是每页能够显示的最大数量 |
Offset | Y | 最小值为 1,代表页数 |
DataTypes.DataList<DataTypes.AuthorizedPrincipal>
根据用户名模糊查询用户列表,同时判断用户是否已经具有指定数据对象的权限。
请求方式:GET
Action:ListIAMUsersWithDataObjectRole
Params:
参数 | 是否必须 | 描述 |
---|---|---|
IdentityName | Y | 用户名,支持模糊查询 |
DataObjectScope | Y | DataObject 对象的层级,可选项为:Schema/Table/UDF/Resource |
SchemaName | Y | Schema Name |
DataObjectName | N | 数据对象名,当 Scope 为 Schema 时,此项为空 |
Limit | N | 这个是每页能够显示的最大数量,默认为 10 |
DataTypes.DataList<DataTypes.IAMUserWithRole>
为用户授予指定数据对象的权限。
请求方式:POST
Action:GrantDataObjectPrivilege
Body:
参数 | 参数类型 | 是否必须 | 描述 |
---|---|---|---|
IdentityList | Array | Y | 用户信息数组 |
IdentityList.AccountID | String | N | 用户 AccountID,默认为当前用户 AccountID |
IdentityList.IdentityId | String | Y | 用户/组 ID |
IdentityList.IdentityType | String | Y | 用户类型:User/Group/GroupDataLeap |
DataObjectScope | String | Y | DataObject 对象的层级,可选项为:Schema/Table/UDF/Resource |
SchemaName | String | Y | Schema Name |
DataObjectName | String | N | 数据对象名,当 Scope 为 Schema 时,此项为空 |
Role | String | Y | 角色(对数据对象的操作权限),可选项为:Admin/Viewer/Developer |
ExpiredDays | Int | N | 过期天数,e.g.: 30 表示申请 30 天的权限,从今天开始,30 天后到期。
|
回收用户对指定数据对象的权限。
请求方式:POST
Action:RevokeDataObjectPrivilege
Body:
参数 | 参数类型 | 是否必须 | 描述 |
---|---|---|---|
IdentityList | Array | Y | 用户信息数组 |
IdentityList.AccountID | String | N | 用户 AccountID,默认为当前用户 AccountID |
IdentityList.IdentityId | String | Y | 用户/组 ID |
IdentityList.IdentityType | String | Y | 用户类型:User/Group/GroupDataLeap |
DataObjectScope | String | Y | DataObject 对象的层级,可选项为:Schema/Table/UDF/Resource |
SchemaName | String | Y | Schema Name |
DataObjectName | String | N | 数据对象名,当 Scope 为 Schema 时,此项为空 |
Role | String | Y | 角色:Admin/Viewer/Developer |
修改用户对指定对象的权限。实际效果可以简单理解为:先对老的权限 RevokeDataObjectPrivilege,然后再对新的权限 GrantDataObjectPrivilege 。
请求方式:POST
Action:AlterDataObjectPrivilege
Body:
参数 | 参数类型 | 是否必须 | 描述 |
---|---|---|---|
IdentityList | Array | Y | 用户信息数组 |
IdentityList.AccountID | String | N | 用户 AccountID,默认为当前用户 AccountID |
IdentityList.IdentityId | String | Y | 用户/组 ID |
IdentityList.IdentityType | String | Y | 用户类型:User/Group/GroupDataLeap |
DataObjectScope | String | Y | DataObject 对象的层级,可选项为:Schema/Table/UDF/Resource |
SchemaName | String | Y | Schema Name |
DataObjectName | String | N | 数据对象名,当 Scope 为 Schema 时,此项为空 |
OldRole | String | Y | 老角色(对数据对象的操作权限),可选项为:Admin/Viewer/Developer |
Role | String | Y | 角色(对数据对象的操作权限),可选项为:Admin/Viewer/Developer |
ExpiredDays | Int | N | 过期天数,e.g.: 30 表示申请 30 天的权限,从今天开始,30 天后到期。
|
参数 | 类型 | 描述 |
---|---|---|
Success | boolean | 是否操作成功 |
参数 | 类型 | 描述 |
---|---|---|
Data | []T | 数据实体 Array |
Limit | int | limit |
Offset | int | offset |
Total | int | total |
参数 | 类型 | 描述 |
---|---|---|
AccountId | String | 用户所属租户的 AccountID |
IdentityId | String | 用户/组 ID |
IdentityName | String | 用户/组 名称 |
IdentityType | String | 用户类型:User/Group |
Role | String | 角色:Admin/Viewer/Developer |
AuthorizedSource | String | 授权来源:由 xxx 授予、源自继承 |
IsInherit | Boolean | true/false,true 表示源自继承,无法修改 & 删除 |
ExpiredTime | String | 到期时间:2021-12-30 23:23:23,-1 表示“永久授权”。 对于 UDF/Resource/Queue,此项为空。 |
ExpiredDays | Int | 到期天数:20, -1 表述“永久授权” |
参数 | 类型 | 描述 |
---|---|---|
AccountId | String | 用户所属租户的 AccountID |
IdentityId | String | 用户/组 ID |
IdentityName | String | 用户/组 名称 |
IdentityType | String | 用户类型:User/Group |
Role | String | 角色:Admin/Viewer/Developer,如果没有 Role,则为空。多个以 ,逗号“,”分隔 |