Help Center/ Data Lake Insight/ API Reference/ Permission-related APIs/ Checking the Permissions Granted to a User
Updated on 2025-09-16 GMT+08:00

Checking the Permissions Granted to a User

Function

This API is used to check the permissions granted to a user.

URI

  • URI format

    GET /v1.0/{project_id}/authorization/privileges

  • Parameter descriptions:
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used for resource isolation. For how to obtain a project ID, see Obtaining a Project ID.

Constraints

None

Range

The value can contain 1 to 64 characters. Only letters and digits are allowed.

Default Value

None

Table 2 query parameter descriptions

Parameter

Mandatory

Type

Description

object

Yes

String

Data object to be assigned, which corresponds to the object in API permission assignment.

  • jobs.flink.Flink job ID, data in the specified job will be queried.
  • groups.Package group name, data in the specified package group will be queried.
  • resources.Package name, data in the specified package will be queried.
NOTE:

When you view the packages in a group, the object format is resources.package group name/package name.

The following is an example of the URL containing the query parameter:

GET /v1.0/{project_id}/authorization/privileges?object={object}

Request Parameters

None

Response Parameters

Table 3 Response parameters

Parameter

Mandatory

Type

Description

is_success

Yes

Boolean

Whether the request is successfully executed. true indicates that the request is successfully executed.

message

Yes

String

Indicates the system prompt. If the execution succeeds, this parameter may be left blank.

object_name

No

String

Object name.

object_type

No

String

Object type. Options:

  • database: database.
  • table: data table.
  • column: column.
  • queue: queue.
  • datasourceauth: enhanced datasource connection.
  • resource: resource package.
  • group: resource package group.
  • elasticresourcepool: elastic resource pool.
  • variable: global variable.

privileges

No

Array of Object

Permission information. For details, see Table 4.

count

No

Integer

Total number of permissions.

Table 4 privileges parameters

Parameter

Mandatory

Type

Description

object

No

String

Data object whose permissions are to be granted, which corresponds to the object in the permission assignment API.

is_admin

No

Boolean

Whether the database user is an administrator.

user_name

No

String

Name of the user who has permission on the current database.

privileges

No

Array of Strings

Permission of the user on the database.

Example Request

None

Example Response

{
    "is_success": true,
    "message": "",
    "object_name": "9561",
    "object_type": "flink",
    "count": 2,
    "privileges": [
        {
            "user_name": "testuser1",
            "is_admin": true,
            "privileges": [
                "ALL"
            ]
        },
        {
            "user_name": "user1",
            "is_admin": false,
            "privileges": [
                "GET"
            ]
        }
    ]
}

Status Codes

Table 5 describes status codes.

Table 5 Status codes

Status Code

Description

200

Authorization succeeds.

400

Request error.

500

Internal server error.

Error Codes

If an error occurs when this API is called, the system does not return the result similar to the preceding example, but returns an error code and error message. For details, see Error Codes.

Table 6 Error codes

Error Code

Error Message

DLI.0001

user input validation failed, object_type sql or spark is not supported now