All Products
Search
Document Center

Data Management:ListDatabaseUserPermssions

Last Updated:Nov 28, 2024

Queries the permissions of users on a database.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListDatabaseUserPermssionslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TidlongNo

The ID of the tenant.

Note : To view the ID of the tenant, log on to the Data Management (DMS) console and move the pointer over the profile picture in the upper-right corner. For more information, see Manage DMS tenants.
-1
PermTypestringYes

The type of the permission. Valid values:

  • DATABASE: permissions on databases
  • TABLE: permissions on tables
  • COLUMN: permissions on fields
DATABASE
DbIdstringYes

The ID of the database.

123
LogicbooleanNo

Specifies whether the database is a logical database.

false
UserNamestringNo

The nickname of the user.

search_user_name
PageNumberintegerNo

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page.

10

Response parameters

ParameterTypeDescriptionExample
object
TotalCountlong

The total number of entries returned.

1
RequestIdstring

The ID of the request.

68075D06-7406-4887-83A7-F558A4D28C13
ErrorCodestring

The error code returned if the request failed.

UnknownError
ErrorMessagestring

The error message returned if the request failed.

UnknownError
UserPermissionsarray<object>

The details of user permissions.

UserPermissionobject
DbIdstring

The ID of the database.

1234
TableNamestring

The name of the table.

table_name
UserIdstring

The ID of the user.

14324
SchemaNamestring

The name of the database.

xxx@xxxx:3306
Logicboolean

Indicates whether the database is a logical database.

false
UserNickNamestring

The nickname of the user.

user_nick_name
InstanceIdstring

The ID of the instance.

1443
PermDetailsarray<object>

The details of user permissions.

PermDetailobject
OriginFromstring

The description of the entity that authorizes the permission.

xxx grant
PermTypestring

The type of the permission. Valid values:

  • QUERY: the query permissions
  • EXPORT: the export permissions
  • CORRECT: the change permissions
QUERY
ExpireDatestring

The time when the permissions expire.

2020-12-12 00:00:00
CreateDatestring

The time when the permission was created.

2019-12-12 00:00:00
UserAccessIdstring

The ID of the authorization record.

13434
ExtraDatastring

The extra information. This parameter is reserved.

DEFAULT
EnvTypestring

The type of the environment to which the database belongs.

product
ColumnNamestring

The name of a column.

column_name
DbTypestring

The type of the database engine.

mysql
DsTypestring

The type of resources on which the user has permissions.

DATABASE
TableIdstring

The ID of the table.

42345
SearchNamestring

The name that is used to search for the database.

xxx
Aliasstring

The alias of the database instance.

instance_alias
Successboolean

Indicates whether the request is successful.

true

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "RequestId": "68075D06-7406-4887-83A7-F558A4D28C13",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "UserPermissions": {
    "UserPermission": [
      {
        "DbId": "1234",
        "TableName": "table_name",
        "UserId": "14324",
        "SchemaName": "xxx@xxxx:3306",
        "Logic": false,
        "UserNickName": "user_nick_name",
        "InstanceId": "1443",
        "PermDetails": {
          "PermDetail": [
            {
              "OriginFrom": "xxx grant",
              "PermType": "QUERY",
              "ExpireDate": "2020-12-12 00:00:00",
              "CreateDate": "2019-12-12 00:00:00",
              "UserAccessId": "13434",
              "ExtraData": "DEFAULT"
            }
          ]
        },
        "EnvType": "product",
        "ColumnName": "column_name",
        "DbType": "mysql",
        "DsType": "DATABASE",
        "TableId": "42345",
        "SearchName": "xxx",
        "Alias": "instance_alias"
      }
    ]
  },
  "Success": true
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history