Querying Permissions of a User Directly Associated with an Enterprise Project
Function
This API is used to query the permissions of a user directly associated with a specified enterprise project.
The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.
URI
GET /v3.0/OS-PERMISSION/enterprise-projects/{enterprise_project_id}/users/{user_id}/roles
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| enterprise_project_id | Yes | String | Enterprise project ID. |
| user_id | Yes | String | User ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Authenticated token with iam:permissions:listRolesForUserOnEnterpriseProject or Security Administrator permission. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| roles | Array of RolesItem objects | Role list. |
| Parameter | Type | Description |
|---|---|---|
| catalog | String | Service catalog of the permission. |
| display_name | String | Display name of the permission. |
| description | String | Description of the permission in English. |
| description_cn | String | Description of the permission in Chinese. |
| domain_id | String | ID of the account to which the permission belongs. |
| flag | String | If this parameter is set to fine_grained, the permission is a system-defined policy. |
| id | String | Permission ID. |
| name | String | Permission name. |
| object | Content of the permission. | |
| type | String | Display mode of the permission. NOTE:
|
| Parameter | Type | Description |
|---|---|---|
| Depends | Array of PolicyDepends objects | Dependency permissions. |
| Statement | Array of PolicyStatement objects | Statement of the permission. |
| Version | String | Policy version. NOTE:
|
| Parameter | Type | Description |
|---|---|---|
| catalog | String | Service catalog of the permission. |
| display_name | String | Display name of the permission. |
| Parameter | Type | Description |
|---|---|---|
| Action | Array of strings | Specific operation permission on a resource. A maximum of 100 actions are allowed. NOTE:
|
| Effect | String | Effect of the permission. The value can be Allow or Deny. If both Allow and Deny statements are found in a policy, the authentication starts from the Deny statements. |
| Condition | Object | Conditions for the permission to take effect. A maximum of 10 conditions are allowed. |
| Resource | Array of strings | Cloud resource. The array can contain a maximum of 10 resource strings, and each string cannot exceed 128 characters. NOTE:
|
Example Request
GET https://iam.myhuaweicloud.com/v3.0/OS-PERMISSION/enterprise-projects/{enterprise_project_id}/users/{user_id}/roles Example Response
Status code: 200
The request is successful.
{
"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" : "9698542758bc422088c0c3eabfc30d12",
"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" : "24e7a89bffe443979760c4e9715c13a5",
"type" : "XA",
"name" : "custom_9698542758bc422088c0c3eabfc30d12_0"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The request is successful. |
| 400 | Parameter error. |
| 401 | Authentication failed. |
| 403 | Access denied. |
| 404 | The requested resource cannot be found. |
| 500 | The system is abnormal. |
Last Article: Querying Users Directly Associated with an Enterprise Project
Next Article: Granting a User Permissions for an Enterprise Project
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.