Call GrantUserPermission to grant permissions for user libraries and tables.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes GrantUserPermission

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

DbId String Yes 1234

The ID of the database.

DsType String Yes DATABASE

The permission type. The values and descriptions are as follows:

  • DATABASE: permissions on physical databases
  • LOGIC_DATABASE: the permissions on logical databases.
  • TABLE: permissions on physical tables
  • LOGIC_TABLE: logical table permissions
ExpireDate String Yes 2019-12-12 00:00:00

The time when the permissions expired.


The permission type. Separate multiple permission types with commas (,). The values and are described as follows:

  • QUERY: the QUERY permission
  • EXPORT: EXPORT permission
  • CORRECT: the permission to change
Tid Long Yes -1

The ID of the tenant.

Note The tenant ID is taken from the avatar in the upper-right corner of the system. For more information, see Tenant ID and Tenant .
UserId String Yes 12345

The user ID, which corresponds to the user ID in the GetUser API. Note that it is not the user's Alibaba Cloud Uid.

Logic Boolean No false

Specifies whether the database is a logical database.

TableId String No 1324245

The ID of the table. This parameter must be specified when you grant table permissions.

TableName String No table_name

The name of the table. This parameter must be specified when you grant table permissions.

Response parameters

Parameter Type Example Description
ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message of the failure.

RequestId String A99CD576-1E18-4E86-931E-C3CCE56DC030

The ID of the request.

Success Boolean true

Indicates whether the request is successful.


Sample requests

     http(s)://[Endpoint]/? Action=GrantUserPermission &DbId=1234 &DsType=DATABASE &ExpireDate=2019-12-12 00:00:00 &PermTypes=QUERY, EXPORT, CORRECT &Tid=-1 &UserId=12345 &<common request parameters> 

Sample success responses

XML format

     <RequestId>A99CD576-1E18-4E86-931E-C3CCE56DC030</RequestId> <Success>true</Success> 

JSON Format

     { "RequestId": "A99CD576-1E18-4E86-931E-C3CCE56DC030", "Success": true } 

Error codes

Go to the Error Center For more information, see error codes.