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.
Debugging
You can debug this API in API Explorer.
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 permissions. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
Array of 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 which the permission belongs to. |
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 |
---|---|---|
Array of objects |
Dependency permissions. |
|
Array of 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 permissions on a resource. For details about supported actions, see "Permissions and Supported Actions" in the API Reference of cloud services.
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. |
Resource |
Object |
Cloud resource.
NOTE:
|
Example Request
Request for querying permissions of a user directly associated with an enterprise project
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" : "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...." } ] }
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. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot