Help Center> CodeArts Deploy> API Reference> APIs> Managing Application Permissions> Querying the Instance-Level/Project-Level Permission Matrix of an Application
Updated on 2024-07-05 GMT+08:00

Querying the Instance-Level/Project-Level Permission Matrix of an Application

Function

This API is used to query the instance-level or project-level permission matrix of an application. If app_id is transferred, the instance-level permission matrix is queried. If project_id is transferred while app_id is not transferred, the project-level permission matrix is queried.

Calling Method

For details, see Calling APIs.

URI

GET /v3/applications/permissions

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

app_id

No

String

Application ID

Minimum: 32

Maximum: 32

project_id

No

String

Project ID

Minimum: 32

Maximum: 32

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 0

Maximum: 20000

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

result

Array of ApplicationPermissionVO objects

Role application permission

status

String

Request success or failure status

Table 4 ApplicationPermissionVO

Parameter

Type

Description

can_modify

Boolean

Whether you have the edit permission

can_delete

Boolean

Whether you have the delete permission

can_view

Boolean

Whether you have the view permission

can_execute

Boolean

Whether you have the execute permission

can_copy

Boolean

Whether you have the clone permission

can_manage

Boolean

Whether you have the manage permission, including adding, deleting, modifying, querying, executing, and modifying permissions.

can_create_env

Boolean

Whether you have the permission to create environments

can_disable

Boolean

Whether you have the disable permission

name

String

Role name

region

String

Region information

role_id

String

Role ID

role_type

String

Role type. app-creator: Application creator. project: Project administrator. template-customized-inst: System roles. template-project-customized and project-customized: Custom roles.

Enumeration values:

  • app-creator

  • project

  • template-customized-inst

  • template-project-customized

  • project-customized

Example Requests

  • This API is used to query the project-level permission matrix of an application.

    https://{endpoint}/v3/applications/permissions?project_id=0a38ce9ba3c740c199a0f872b6163661
  • This API is used to query the instance-level permission matrix of an application.

    https://{endpoint}/v3/applications/permissions?app_id=0a38ce9ba3c740c199a0f872b6163661

Example Responses

Status code: 200

OK: The request is successful.

{
  "result" : [ {
    "can_copy" : true,
    "can_create_env" : true,
    "can_delete" : true,
    "can_disable" : true,
    "can_execute" : true,
    "can_manage" : true,
    "can_modify" : true,
    "can_view" : true,
    "name" : "App creator",
    "region" : "cn-north-7",
    "role_id" : "0",
    "role_type" : "app-creator"
  }, {
    "can_copy" : true,
    "can_create_env" : true,
    "can_delete" : true,
    "can_disable" : true,
    "can_execute" : true,
    "can_manage" : true,
    "can_modify" : true,
    "can_view" : true,
    "name" : "Project Admin",
    "region" : "cn-north-7",
    "role_id" : "2e510051361942a8b7ecea00144172b3",
    "role_type" : "project"
  } ],
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK: The request is successful.

Error Codes

See Error Codes.