查看角色删除影响

查看删除指定角色前仍需处理的绑定、继承、所有权、授权和待处理变更。查看结果是当前快照,删除时仍会再次检查。

GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/iam/roles/{role_id}/delete-impact

调用前准备

先选择角色,确认要评估的角色,并以列表中的当前状态为准查看影响。

准备具有目标工作区相应权限的个人访问令牌和目标工作区 ID。

请求参数

curl -G "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/delete-impact" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode "expected_lifecycle_version=3"

路径参数

参数

类型

是否必填

说明

workspace_id

string

是

目标工作区 ID。

role_id

string

是

目标角色 ID。

查询参数

参数

类型

是否必填

说明

expected_lifecycle_version

integer

是

当前角色生命周期版本,必须大于 0。

删除影响是查看时快照,不能代替删除接口的最终检查。执行删除时仍须提交最新生命周期版本。

成功响应

成功时返回可能阻止删除的角色绑定、继承、所有权、策略授权和待处理操作数量。

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "role": {
      "role_id": "role-001",
      "lifecycle_state": "disabled",
      "lifecycle_version": 3
    },
    "direct_binding_count": 0,
    "default_role_count": 0,
    "parent_inheritance_count": 0,
    "child_inheritance_count": 0,
    "active_ownership_count": 0,
    "active_policy_grant_count": 0,
    "pending_operation_count": 0,
    "blocked": false
  }
}

字段

类型

说明

code

string

成功时为 OK。

msg

string

成功时为 OK。

data.role

object

被检查的角色摘要。

data.direct_binding_count

integer

直接绑定该角色的用户数量。

data.default_role_count

integer

将该角色设为默认角色的用户数量。

data.parent_inheritance_count

integer

该角色的直接父继承数量。

data.child_inheritance_count

integer

直接继承该角色的子角色数量。

data.active_ownership_count

integer

该角色持有的有效所有权数量。

data.active_policy_grant_count

integer

仍引用该角色的有效策略授权数量。

data.pending_operation_count

integer

尚未完成或待恢复的操作数量。

data.blocked

boolean

当前是否存在删除阻塞项。

错误响应

{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

字段

类型

说明

code

string

错误代码。

msg

string

错误信息。

data

null

—

后续操作

确认删除影响

删除角色前,确认没有仍需处理的绑定、继承、所有权、授权或待处理变更。查看结果是快照,实际删除时仍会重新检查。

最后更新于