Help Center/ CodeArts Artifact/ API Reference/ API/ User Management/ Updating Repository Permissions
Updated on 2025-09-08 GMT+08:00

Updating Repository Permissions

Function

Update repository permissions.

Calling Method

For details, see Calling APIs.

URI

PUT /cloudartifact/v5/repositories/{role_id}/privileges

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

role_id

Yes

String

Definition:

Role ID.

Constraints:

N/A

Value range:

N/A

Default value:

None

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

privileges

Yes

Array of PrivilegeParam objects

Definition:

Permission information.

Constraints:

N/A

Value range:

N/A

Default value:

None

Table 3 PrivilegeParam

Parameter

Mandatory

Type

Description

role_id

Yes

String

Definition:

Role ID.

Constraints:

N/A

Value range:

N/A

Default value:

None

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

area_service_id

Yes

String

Definition:

Region service ID.

Constraints:

N/A

Value range:

N/A

Default value:

None

granted_object_path

Yes

String

Definition:

Authorization object path.

Constraints:

N/A

Value range:

N/A

Default value:

None

granted_object_type_id

Yes

String

Definition:

Authorization object ID.

Constraints:

N/A

Value range:

N/A

Default value:

None

operations

Yes

String

Definition:

Operation permission. Use commas (,) to separate multiple permissions.

Constraints:

N/A

Value range:

createrepository, editrepository, restore, deleterepository, physicdelete, restoreall, clearall, deleteorredeploy, downloadorview, import, upload, and export.

Default value:

None

Response Parameters

Status code: 200

Table 4 Response body parameters

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

Array of Privilege objects

Definition:

Permission information.

Value range:

N/A

Table 5 Privilege

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

Update repository permissions.

https://{URL}/cloudartifact/v5/repositories/6aa36d3dc51e4c0xxxx4da3047306/privileges

{
  "privileges" : [ {
    "granted_object_type_id" : "f1ba90c4xxxxaec9316b45408921",
    "granted_object_path" : "/codeartsartifact/artifact/component/xx-xxx-x_09d2ca2fxxxx0f51c00ae5bad0a0_docker2_5_27",
    "operations" : "downloadorview,export,import",
    "project_id" : "73e0adda5axxx8a1f869ec2a28a06",
    "role_id" : "6aa36d3dc51e4cxxx54da3047306",
    "area_service_id" : "c0ec24a43xxxx07785d882cf23a"
  }, {
    "granted_object_type_id" : "f9fa2e820725xxx0b1fa99ce931e",
    "granted_object_path" : "/codeartsartifact/artifact/repo/xx-xxx-x_09d2ca2f5080d5xxxxe5bad0a0_docker2_5_27",
    "operations" : "editrepository,restore,physicdelete,createrepository,restoreall",
    "project_id" : "73e0adda5acxxx1f869ec2a28a06",
    "role_id" : "6aa36d3dc51e4xxxx54da3047306",
    "area_service_id" : "c0ec24a435a640xxxx7785d882cf23a"
  } ]
}

Example Responses

Status code: 200

OK

{
  "status" : "success",
  "trace_id" : "20dadb7a95e34xxxxx60e1736ba771",
  "result" : [ {
    "operations" : "downloadorview,export,import",
    "role_id" : "6aa36d3dc51exxx4e154da3047306",
    "role_name" : null,
    "role_chinese_name" : null,
    "project_id" : "73e0adda5ace41f28xxxec2a28a06",
    "area_service_id" : "c0ec24a435a64xxx07785d882cf23a",
    "granted_object_path" : "/codeartsartifact/artifact/component/xx-xxx-x_09d2ca2f5xxxb60f51c00ae5bad0a0_docker2_5_27",
    "granted_object_type_id" : "f1ba90c49e17xxxc9316b45408921",
    "operations_index" : null
  }, {
    "operations" : "editrepository,restore,physicdelete,createrepository,restoreall",
    "role_id" : "6aa36d3dc51e4c088xxxxda3047306",
    "role_name" : null,
    "role_chinese_name" : null,
    "project_id" : "73e0adda5ace41xxxec2a28a06",
    "area_service_id" : "c0ec24a435a640xxxxd882cf23a",
    "granted_object_path" : "/codeartsartifact/artifact/repo/xx-xxx-x_09d2ca2f508xxxx51c00ae5bad0a0_docker2_5_27",
    "granted_object_type_id" : "f9fa2e8207254xxxxa0b1fa99ce931e",
    "operations_index" : null
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.