Querying Table Users

Function

This API is used to query users who have permission to access the specified table or column in the table.

URI

Request

None

Response

Table 2 Response parameters

Parameter

Mandatory

Type

Description

is_success

No

Boolean

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

message

No

String

System prompt. If execution succeeds, the parameter setting may be left blank.

privileges

No

Array <Objects>

Permission information. For details, see Table 3.

Table 3 privileges parameters

Parameter

Mandatory

Type

Description

is_admin

No

Boolean

Whether the table user is an administrator.

object

No

String

Objects on which a user has permission.

  • If the object is in the format of databases.Database name.tables.Table name, the user has permission on the database.
  • If the object is in the format of databases.Database name.tables.Table namecolumns.Column name, the user has permission on the table.

privileges

No

Array<String>

Permission of the user on the object.

user_name

No

String

Name of the user who has the permission.

Example Request

None

Example Response

{
  "is_success": true,
  "message": "",
  "privileges": [
    {
      "is_admin": false,
      "object": "databases.dsstest.tables.csv_par_table",
      "privileges": [
        "SELECT"
      ],
      "user_name": "tent2"
    },
    {
      "is_admin": true,
      "object": "databases.dsstest.tables.csv_par_table",
      "privileges": [
        "ALL"
      ],
      "user_name": "tent4"
    }
  ]
}

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