查询企业项目直接关联用户的权限
调试
您可以在API Explorer中调试该接口。
URI
GET /v3.0/OS-PERMISSION/enterprise-projects/{enterprise_project_id}/users/{user_id}/roles
| 参数 | 是否必选 | 参数类型 | 描述 | 
|---|---|---|---|
| enterprise_project_id | 是 | String | 企业项目ID。 | 
| user_id | 是 | String | 用户ID。 | 
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 | 
|---|---|---|---|
| X-Auth-Token | 是 | String | 已认证的拥有iam:permissions:listRolesForUserOnEnterpriseProject细粒度权限或Security Administrator权限的token。 | 
响应参数
状态码: 200
| 参数 | 参数类型 | 描述 | 
|---|---|---|
| Array of objects | 角色列表。 | 
| 参数 | 参数类型 | 描述 | 
|---|---|---|
| catalog | String | 权限所在目录。 | 
| display_name | String | 权限展示名称。 | 
| description | String | 权限的英文描述。 | 
| description_cn | String | 权限的中文描述信息。 | 
| domain_id | String | 权限所属账号ID。 | 
| flag | String | 该参数值为fine_grained时,标识此权限为系统内置的策略。 | 
| id | String | 权限Id。 | 
| name | String | 权限名称。 | 
| object | 权限具体内容。 | |
| type | String | 权限的显示模式。 
         说明: 
         
 | 
| 参数 | 参数类型 | 描述 | 
|---|---|---|
| Array of objects | 该权限所依赖的权限。 | |
| Array of objects | 授权语句,描述权限的具体内容。 | |
| Version | String | 权限版本号。 
         说明: 
         
 | 
| 参数 | 参数类型 | 描述 | 
|---|---|---|
| Action | Array of strings | 授权项,指对资源的具体操作权限。支持的授权项请参考各云服务《API参考》中“权限和授权项”章节。 
         说明: 
         
 | 
| Effect | String | 作用。包含两种:允许(Allow)和拒绝(Deny),既有Allow又有Deny的授权语句时,遵循Deny优先的原则。 | 
| Condition | Object | 限制条件。 | 
| Resource | Object | 资源。规则如下: 
         说明: 
         
 | 
请求示例
查询企业项目直接关联用户的权限。
GET https://iam.myhuaweicloud.com/v3.0/OS-PERMISSION/enterprise-projects/{enterprise_project_id}/users/{user_id}/roles
 响应示例
状态码: 200
请求成功。
{
  "roles" : [ {
    "display_name" : "Customed ECS Viewer",
    "description" : "The read-only permissions to all ECS resources, which can be used for statistics and survey.",
    "domain_id" : "9698542758bc422088c0c3eabfc30d...",
    "catalog" : "CUSTOMED",
    "policy" : {
      "Version" : "1.1",
      "Statement" : [ {
        "Action" : [ "ecs:*:get*", "ecs:*:list*", "ecs:blockDevice:use", "ecs:serverGroups:manage", "ecs:serverVolumes:use", "evs:*:get*", "evs:*:list*", "vpc:*:get*", "vpc:*:list*", "ims:*:get*", "ims:*:list*" ],
        "Effect" : "Allow"
      } ]
    },
    "id" : "24e7a89bffe443979760c4e9715c1...",
    "type" : "XA",
    "name" : "custom_9698542758bc422088c0c3eabfc30...."
  } ]
}
 状态码
| 状态码 | 描述 | 
|---|---|
| 200 | 请求成功。 | 
| 400 | 请求参数出错。 | 
| 401 | 认证失败。 | 
| 403 | 没有操作权限。 | 
| 404 | 找不到指定资源。 | 
| 500 | 系统异常。 | 
 
  