Querying a User's Table Permissions (Discarded)¶
Function¶
This API is used to query the permission of a specified user on a table.
Note
This API has been discarded and is not recommended.
URI¶
URI format
GET /v1.0/{project_id}/databases/{database_name}/tables/{table_name}/users/{user_name}
Parameter description
¶ Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.
database_name
Yes
String
Name of the database where the table to be queried resides.
table_name
Yes
String
Name of a table that is to be queried.
user_name
Yes
String
Name of the user whose permission is to be queried.
Request¶
None
Response¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
is_success | No | Boolean | Whether the request is successfully executed. Value true indicates that the request is successfully executed. Example value: true. |
message | No | String | System prompt. If execution succeeds, the parameter setting may be left blank. Example value: left blank. |
user_name | No | String | Name of the user whose permission is to be queried. |
privileges | No | Array Of objects | Permission information. For details, see Table 3. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
object | No | String | Objects on which a user has permission.
|
privileges | No | Array of Strings | Permission of the user on a specified object. Example value: [DESCRIBE_TABLE]. |
Example Request¶
None
Example Response¶
{
"is_success": true,
"message": "",
"privileges": [
{
"object": "databases.dsstest.tables.obs_2312",
"privileges": [
"DESCRIBE_TABLE"
]
},
{
"object": "databases.dsstest.tables.obs_2312.columns.id",
"privileges": [
"SELECT"
]
}
],
"user_name": "scuser1"
}
Status Codes¶
Table 4 describes the status code.
Status Code | Description |
---|---|
200 | Authorization succeeds. |
400 | Request error. |
500 | Internal service error. |
Error Codes¶
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 Codes.