Updated on 2025-09-19 GMT+08:00

Querying Database Object Permissions

Function

This API is used to query database object permissions.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/clusters/{cluster_id}/db-manager/authority

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

cluster_id

Yes

String

Definition

Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Definition

Object type.

Constraints

N/A

Range

DATABASE, SCHEMA, TABLE, VIEW, COLUMN, FUNCTION, SEQUENCE, or NODEGROUP

Default Value

N/A

name

Yes

Array of strings

Definition

Object name.

Constraints

N/A

Range

N/A

Default Value

N/A

database

Yes

String

Definition

Database name.

Constraints

N/A

Range

N/A

Default Value

N/A

schema

No

String

Definition

Schema name. This parameter is mandatory when the object type is TABLE, VIEW, COLUMN, FUNCTION, or SEQUENCE.

Constraints

N/A

Range

N/A

Default Value

N/A

table

No

String

Definition

Table name. This parameter is mandatory when the object type is COLUMN.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

authorities

Array of ObjectAuthority objects

Definition

Object permission set.

Range

N/A

Table 4 ObjectAuthority

Parameter

Type

Description

name

String

Definition

Object name.

Range

N/A

role_authority

Array of RoleAuthority objects

Definition

Role permission set.

Range

N/A

Table 5 RoleAuthority

Parameter

Type

Description

role

String

Definition

Role name.

Range

N/A

right_list

Array of strings

Definition

Permission list.

Range

N/A

Example Requests

GET https://{Endpoint}/v1/0536cdee2200d5912f7cc00b877980f1/clusters/a89aea88-7ea2-40bd-8ac8-8b93e169e5d6/db-manager/authority

Example Responses

Status code: 200

Query succeeded.

{
  "authorities" : [ {
    "name" : "table1",
    "role_authority" : [ {
      "role" : "role1",
      "right_list" : [ "SELECT", "UPDATE" ]
    }, {
      "role" : "role2",
      "right_list" : [ "SELECT", "UPDATE" ]
    } ]
  } ]
}

Status Codes

Status Code

Description

200

Query succeeded.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

404

No resources found.

500

Internal server error.

503

Service unavailable.