Querying Repository Permissions
Function
Query repository permissions.
Calling Method
For details, see Calling APIs.
URI
GET /cloudartifact/v5/repositories/{project_id}/{repo_id}/privileges
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. It 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: The value can contain 32 characters. Only letters and digits are supported. Value range: N/A Default value: None |
repo_id |
Yes |
String |
Definition: Repository ID. You can view the repository ID on the General page of the repository. Constraints: N/A Value range: N/A Default value: None |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
x-language |
No |
String |
Definition: Language type. Constraints: N/A Value range: zh-cn and en-us. Default value: zh-cn. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
status |
String |
Definition: Request status. Value range: success: The request is successful. error: The request fails. |
trace_id |
String |
Definition: Request ID, which uniquely identifies the current request. Value range: A string of digits and hyphens (-). |
result |
result object |
Definition: Query result. Constraints: N/A Value range: N/A Default value: None |
Parameter |
Type |
Description |
---|---|---|
$role_name |
Array of Privilege objects |
Definition: Permission information. $role_name is a dynamic role name. Constraints: N/A Value range: N/A Default value: None |
Parameter |
Type |
Description |
---|---|---|
role_id |
String |
Definition: Role ID. Constraints: N/A Value range: N/A Default value: None |
role_name |
String |
Definition: Role name. Constraints: N/A Value range: N/A Default value: None |
role_chinese_name |
String |
Definition: Role name (CN). Constraints: N/A Value range: N/A Default value: None |
project_id |
String |
Definition: Project ID. Constraints: N/A Value range: N/A Default value: None |
area_service_id |
String |
Definition: Region service ID. Constraints: N/A Value range: N/A Default value: None |
granted_object_path |
String |
Definition: Authorization object path. Constraints: N/A Value range: N/A Default value: None |
granted_object_type_id |
String |
Definition: Authorization object ID. Constraints: N/A Value range: N/A Default value: None |
operations |
String |
Definition: Operation permission. Use commas (,) to separate multiple permissions. Constraints: N/A Value range: N/A Default value: None |
operations_index |
Array of integers |
Definition: Operation permission index. Constraints: N/A Value range: N/A Default value: None |
Example Requests
Query repository permissions.
https://{URL}/cloudartifact/v5/repositories/73e0adda5ace41fxxxxec2a28a06/xx-xxx-x_09d2ca2f5080dxxxc00ae5bad0a0_docker2_5_27/privileges
Example Responses
Status code: 200
OK
{ "status" : "success", "trace_id" : "9d97e8db2a9348xxx046f0b91e78ee", "result" : { "System engineer" : [ { "operations" : "downloadorview,import,upload,export", "role_id" : "0e9fa4b22c3cxx3128e2eac3ba17", "role_name" : "System engineer", "role_chinese_name" : "System engineer.", "project_id" : "73e0adda5acexx8a1f869ec2a28a06", "area_service_id" : "c0ec24a435axxb07785d882cf23a", "granted_object_path" : "/codeartsartifact/artifact/component/xx-xxx-x_09d2ca2f508xx51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f1ba90c49e174xxc9316b45408921", "operations_index" : null }, { "operations" : "editrepository,restore,physicdelete", "role_id" : "0e9fa4b22c3c41xx3128e2eac3ba17", "role_name" : "System engineer", "role_chinese_name" : "System engineer.", "project_id" : "73e0adda5acexxf869ec2a28a06", "area_service_id" : "c0ec24a435a64xxb07785d882cf23a", "granted_object_path" : "/codeartsartifact/artifact/repo/xx-xxx-x_09d2ca2f5080dxxxf51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f9fa2e82072xxxa7a0b1fa99ce931e", "operations_index" : null } ], "Project manager" : [ { "operations" : "deleteorredeploy,downloadorview,import,upload,export", "role_id" : "1d87e5606e554xxxx982e4baf1a2", "role_name" : "Project manager", "role_chinese_name" : "Project manager.", "project_id" : "73e0adda5ace41f2xxxxec2a28a06", "area_service_id" : "c0ec24a435a64xxxx85d882cf23a", "granted_object_path" : "/codeartsartifact/artifact/component/xx-xxx-x_09d2ca2f5xxxx60f51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f1ba90c4xxxxfaec9316b45408921", "operations_index" : null }, { "operations" : "createrepository,editrepository,restore,deleterepository,physicdelete,restoreall,clearall", "role_id" : "1d87e5606e5xxxxc4982e4baf1a2", "role_name" : "Project manager", "role_chinese_name" : "Project manager.", "project_id" : "73e0adda5ace41fxxxec2a28a06", "area_service_id" : "c0ec24a435a6407xxxxd882cf23a", "granted_object_path" : "/codeartsartifact/artifact/repo/xx-xxx-x_09d2ca2f50xxxxf51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f9fa2e8207254xxxxa0b1fa99ce931e", "operations_index" : null } ] } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
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