Adding Permissions to a Permission Set
Function
Add permissions to the permission set.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/security/permission-sets/{permission_set_id}/permissions
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Project ID and Account ID. |
| permission_set_id | Yes | String | Permission set ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| workspace | Yes | String | Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID. |
| X-Auth-Token | Yes | String | IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This parameter is mandatory for token authentication. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| dw_id | No | String | Data connection ID. |
| permission_type | No | String | Permission type. The options are DENY and ALLOW. |
| permission_actions | No | Array of strings | Permission operation list. |
| cluster_id | No | String | Cluster ID. |
| cluster_name | No | String | Cluster name |
| datasource_type | No | String | Data Source Type
|
| database_name | No | String | Database name |
| schema_name | No | String | Specifies the schema name. |
| namespace | No | String | Namespace. It is an invalid parameter and will be unavailable soon. |
| table_name | No | String | Specifies the name of the table. |
| column_name | No | String | Column name. |
| row_level_security | No | String | Row-level policy. It is an invalid parameter and will be unavailable soon. |
| url | No | String | URL. It is used in the MRS storage-compute decoupling scenario or when a location is specified for Hive. |
| auto_sync | No | Boolean | Whether to enable automatic synchronization. The default value is false. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| id | String | id. |
| permission_set_id | String | Permission set ID. |
| project_id | String | Project ID. |
| instance_id | String | Instance ID. |
| permission_type | String | Permission type. The options are DENY and ALLOW. |
| permission_action | String | Permission operation list. |
| permission_actions | Array of strings | Permission operation list. |
| permission_action_code | Integer | Permission operation code, which is a bitmap. |
| cluster_id | String | Cluster ID |
| cluster_name | String | Cluster name |
| datasource_type | String | Data source type:
|
| database_name | String | Database name. |
| schema_name | String | Specifies the schema name. |
| namespace | String | Namespace |
| table_name | String | Table name |
| column_name | String | Column name. |
| row_level_security | String | Row-level policy. |
| sync_status | String | Synchronization status. The value is UNKNOWN,NOT_SYNC,SYNCING,SYNC_SUCCESS,SYNC_FAIL. |
| sync_msg | String | Synchronization information. |
| url | String | URL |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Requests
/v1/0833a5737480d53b2f25c010dc1a7b88/security/permission-sets/fea96c90024711b8bf8d6886407b814b/permissions
{
"permission_type" : "ALLOW",
"cluster_id" : "4367f185-79d4-41ae-afd5-54d55176aa68",
"cluster_name" : "mrs_3x_autotest_do_not_del",
"datasource_type" : "HIVE",
"database_name" : "default",
"dw_id" : "88055a9005194bdfa4377714ca166369",
"permission_actions" : [ "SELECT" ],
"table_name" : "*",
"column_name" : "*"
} Example Responses
Status code: 200
OK
{
"cluster_id" : "4367f185-79d4-41ae-afd5-54d55176aa68",
"cluster_name" : "mrs_3x_autotest_do_not_del",
"column_name" : "*",
"database_name" : "default",
"datasource_type" : "HIVE",
"id" : "511fe36e2cc0e33a094a8bdaa4b73e55",
"instance_id" : "dd97167b873d4a79b2aad54d4370a3bc",
"namespace" : null,
"permission_action" : "SELECT",
"permission_action_code" : 2,
"permission_actions" : [ "SELECT" ],
"permission_set_id" : "fea96c90024711b8bf8d6886407b814b",
"permission_type" : "ALLOW",
"project_id" : "0833a5737480d53b2f25c010dc1a7b88",
"row_level_security" : null,
"schema_name" : null,
"sync_msg" : null,
"sync_status" : "NOT_SYNC",
"table_name" : "*",
"url" : null
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.