Call ListUserPermissions to display the database and table permissions of a specified user.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListUserPermissions

The operation that you want to perform. Valid values: ListUserPermissions

PermType String Yes DATABASE

The type of the resource permission. For more information about valid values and descriptions, see ListDatabaseUserPermssions API.

Tid Long Yes -1

The ID of the tenant.

UserId String Yes 13435

The user ID, which corresponds to the user ID in the GetUser API. Note that this is not the Uid of a user.

DatabaseName String No db_name

The name of the database.

Logic Boolean No false

Indicates whether the database was a logical database.

EnvType String No dev

The type of the environment to which the database belongs.

DbType String No mysql

The type of the database instance.

PageNumber String Optional 1

The number of the page to return.

PageSize String Optional 1

Data size per page

Response parameters

Prameter Type Sample response Description
RequestId String C51420E3-144 A- 4A94-B473-8662FC******

The ID of the request.

Success Boolean True

Indicates whether the request was successful.

ErrorMessage String UnknownError

Error message

ErrorCode String UnknownError

Error code

TotalCount Long 6

Records that meet the specified conditions

UserPermissions Array

The list of user permission information.

UserId String 423245

The ID of the user.

UserNickName String nick_name

User Name

DsType String DATABASE

Permission resource type

DbId String 1324

The ID of the database.

Logic Boolean false

Indicates whether the database was a logical database.

SchemaName String test_db

The name of the database.

SearchName String xxxx_xx@xxx:3306

The query name of the database.

InstanceId String 134

Instance ID

EnvType String dev

The type of the environment to which the database belongs.

Alias String instance_alias

The alias of the database instance.

DbType String mysql

The type of the database instance.

TableName String test_table

Table name

TableId String 13434

The ID of the table.

ColumnName String column_name

Field

PermDetails Array

Permission details

PermType String QUERY

Permission type

ExpireDate String 2020-12-12 00:00:00

Expiration Time

CreateDate String 2019-12-12 00:00:00

Grant Time

OriginFrom String xxx

The source information of the permission granting policy.

UserAccessId String 1345

Authorization record ID

ExtraData String xxx

Extra data and reserved parameters

Examples

Sample request

http(s)://[Endpoint]/? Action=ListUserPermissions
&PermType=DATABASE
&Tid=-1
&UserId=13***
&<Common request parameters>

Sample success responses

JSON format

{
  "UserPermissions": {
    "UserPermission": [
      {
        "Logic": false,
        "UserNickName": "xxx",
        "DsType": "DATABASE",
        "Alias": "xxx_ent_dev",
        "PermDetails": {
          "PermDetail": [
            {
              "ExpireDate": "2020-10-31 00:00:00",
              "UserAccessId": "390913",
              "PermType": "EXPORT",
              "OriginFrom": "xxx",
              "CreateDate": "2019-11-21 15:07:45"
            },
            {
              "ExpireDate": "2020-10-31 00:00:00",
              "UserAccessId": "390914",
              "PermType": "CORRECT",
              "OriginFrom": "xxx",
              "CreateDate": "2019-11-21 15:07:45"
            }
          ]
        },
        "InstanceId": 246**,
        "SearchName": "xxx@xxx:3306【xxx_ent_dev】",
        "DbId": 111***,
        "UserId": 886**,
        "DbType": "drds",
        "EnvType": "dev",
        "SchemaName": "xxx_ent_dev"
      }
    ]
  },
  "TotalCount": 6,
  "RequestId": "C51420E3-144A-4A94-B473-8662FC******",
  "Success": true
}

XML format

<UserPermissions>
    <UserPermission>
        <Logic>false</Logic>
        <UserNickName>xxx</UserNickName>
        <DsType>DATABASE</DsType>
        <Alias>xxx_ent_dev</Alias>
        <PermDetails>
            <PermDetail>
                <ExpireDate>2020-10-31 00:00:00</ExpireDate>
                <UserAccessId>390***</UserAccessId>
                <PermType>EXPORT</PermType>
                <OriginFrom>xxx</OriginFrom>
                <CreateDate>2019-11-21 15:07:45</CreateDate>
            </PermDetail>
            <PermDetail>
                <ExpireDate>2020-10-31 00:00:00</ExpireDate>
                <UserAccessId>390***</UserAccessId>
                <PermType>CORRECT</PermType>
                <OriginFrom>xxx</OriginFrom>
                <CreateDate>2019-11-21 15:07:45</CreateDate>
            </PermDetail>
        </PermDetails>
        <InstanceId>24671</InstanceId>
        <SearchName>xxx@xxx:3306【xxx_ent_dev】</SearchName>
        <DbId>111***</DbId>
        <UserId>88***</UserId>
        <DbType>drds</DbType>
        <EnvType>dev</EnvType>
        <SchemaName>xxx_ent_dev</SchemaName>
    </UserPermission>
</UserPermissions>
<TotalCount>6</TotalCount>
<RequestId>C51420E3-144A-4A94-B473-8662FC******</RequestId>
<Success>true</Success>

Error codes.

For a list of error codes, visit the API Error Center.