Querying User Permissions
Function
This API is used to query the roles and permissions of a user in a project, such as creating and editing a repository, uploading, downloading, importing, and exporting packages.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| codeartsartifact:repository:list | List | - | - | - | - |
URI
GET /v5/user/{project_id}/privileges
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID, which can be obtained by calling an API or from the console. For details about how to obtain the project ID, see Obtaining a Project ID (CloudArtifact_api_0015.xml). Constraints N/A Range The value contains 32 characters. Only letters and digits are supported. Default value N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Definition Request status. Range success: The request is successful. error: The request fails. |
| trace_id | String | Definition Request ID, which uniquely identifies the current request. Range A string of digits and hyphens (-). |
| result | result object | Definition Response to the request, role, and permission information. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| operations | String | Definition Operation permission list. Range Strings separated by commas (,). |
| operations_index | Array of integers | Definition Serial number of the operation permission. Range Digit |
| role_id | String | Definition Role ID. Range Max. 32 characters, including letters and digits. |
| role_name | String | Definition Role name (EN). Range Project manager, product manager, test manager, operation manager, system engineer, committer, developer, tester, participant, viewer, and custom roles. |
| role_chinese_name | String | Definition Role name (CN). Range Project manager, Product manager, Test manager, Operation manager, System engineer, Committer, Developer, Tester, Participant, Viewer, and custom roles. |
| project_id | String | Definition Project ID. Range Max. 32 characters, including letters and digits. |
| area_service_id | String | Definition Region service ID. Range Max. 32 characters, including letters and digits. |
| granted_object_path | String | Definition Authorization object path. Range The value can contain letters, digits, slashes (/), and asterisks (*). |
| granted_object_type_id | String | Definition Authorization object type ID. Range Max. 32 characters, including letters and digits. |
Example Requests
https://{endpoint}/v5/user/6666669620d743eca6a57881a0f006fd/privileges Example Responses
Status code: 200
The request is successful.
{
"status" : "success",
"trace_id" : "143006-1700618253925-55",
"result" : {
"operations" : "editRepository,restore,physicdelete,clearall",
"operations_index" : [ 2, 4, 5, 7 ],
"role_id" : "ca9615b14a794146ad1ff3ad9ba79666,",
"role_name" : "Developer,",
"role_chinese_name" : "Developer",
"project_id" : "bef3419620d743eca6a57881a0f00666,",
"area_service_id" : "c0ec24a435a640728b07785d882cf666,",
"granted_object_path" : "/xxxx/aaa/bbb/*,",
"granted_object_type_id" : "f9fa2e8207254e14a7a0b1fa99ce9666"
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The request is successful. |
Error Codes
See Error Codes.
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