Grants permissions on an instance, a database, or a table to a user.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dms:GrantUserPermission | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Tid | long | Yes | The ID of the tenant. Note
To view the ID of the tenant, move the pointer over the profile picture in the upper-right corner of the Data Management (DMS) console. For more information, see the "View information about the current tenant" section of the Manage DMS tenants topic.
| 3*** |
UserId | string | Yes | 51**** | |
DsType | string | Yes | The permissions on a specific type of object that you want to grant to the user. Valid values:
| DATABASE |
InstanceId | long | No | The ID of the instance. You must specify this parameter if you grant permissions on an instance to the user. You can call the ListInstances or GetInstance operation to query the ID of the instance. | 174**** |
DbId | string | Yes | The ID of the database. You can call the ListDatabases operation to query the ID of a physical database and the ListLogicDatabases operation to query the ID of a logical database. Note
The value of the DatabaseId parameter is that of the DbId parameter.
| 1*** |
Logic | boolean | No | Specifies whether the database is a logical database. You must specify this parameter if you grant permissions on a database to the user. Valid values:
| false |
TableId | string | No | The ID of the table. You must specify this parameter if you grant permissions on a table to the user. You can call the ListTables operation to query the table ID. | 132*** |
TableName | string | No | The name of the table. You must specify this parameter if you grant permissions on a table to the user. | table_name |
PermTypes | string | Yes | The permission type. Separate multiple permission types with commas (,). Valid values:
| QUERY |
ExpireDate | string | Yes | The time when the permissions expire. | 2021-12-12 00:00:00 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "A99CD576-1E18-4E86-931E-C3CCE56DC030",
"ErrorCode": "UnknownError",
"ErrorMessage": "UnknownError",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|