Querying Permissions of a User or Role
Function
This API is used to query the permissions of a user or role.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/clusters/{cluster_id}/db-manager/users/{name}/authority
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 |
name |
Yes |
String |
Definition Username or role name. Constraints N/A Range N/A Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
Integer |
Definition Page offset, which starts from 0 (page number minus 1). Constraints N/A Range Greater than or equal to 0 Default Value 0 |
limit |
No |
Integer |
Definition Size of a single page. Constraints N/A Range N/A Default Value 1000 |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
authority_list |
Array of GrantAuthority objects |
Definition Permission details list. Range N/A |
count |
Integer |
Definition Total number of permissions. Range N/A |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Definition Permission type. Range N/A |
database |
String |
Definition Database name. Range N/A |
schema |
String |
Definition Schema name. Range N/A |
obj_name |
String |
Definition Object name. Range N/A |
all_object |
Boolean |
Definition Whether the permission applies for all objects. Range N/A |
future |
Boolean |
Definition Whether the permission applies for future objects. Range N/A |
future_object_owners |
String |
Definition Future object - owner. Range N/A |
column_name |
Array of strings |
Definition Column name. Range N/A |
privileges |
Array of Grant objects |
Definition Permission. Range N/A |
Parameter |
Type |
Description |
---|---|---|
permission |
String |
Definition Permission name. The permission varies depending on the database object type. Range
|
grant_with |
Boolean |
Definition Whether a permission is included in the grant options. Range N/A |
Example Requests
Query the permissions of user1.
GET https://{Endpoint}/v1/05f2cff45100d5112f4bc00b794ea08e/clusters/cc6588d6-8301-4c9a-b0c0-186bb824e8c0/db-manager/users/user1/authority
Example Responses
Status code: 200
User or role list queried.
{ "authority_list" : [ { "type" : "DATABASE", "database" : "gaussdb", "schema" : null, "obj_name" : null, "all_object" : false, "future" : false, "future_object_owners" : null, "column_name" : null, "privileges" : [ { "permission" : "CREATE", "grant_with" : false }, { "permission" : "TEMPORARY", "grant_with" : false }, { "permission" : "CONNECT", "grant_with" : false } ] } ], "count" : 2 }
Status Codes
Status Code |
Description |
---|---|
200 |
User or role list queried. |
400 |
Request error. |
401 |
Authentication failed. |
403 |
You do not have required permissions. |
417 |
Internal server error. |
500 |
Internal server error. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot