Column-level permission management
You can use natural language commands to drive code agents, such as Qoder and CodeX, to grant, revoke, query, and perform a permission check on column-level (field-level) resource permissions in Dataphin. This allows you to control the visibility of sensitive fields like phone numbers, ID card numbers, and salaries. This topic describes the capability's features, prerequisites, and examples. It also explains the expected results and lists the required information in the appendix.
Overview
The column-level permission management capability lets you manage column-level (field-level) resource permissions in Dataphin using natural language commands. Common tasks include granting or revoking view (SELECT) permissions on a field for specific users, querying authorization records and operation logs for a table or field, running a permission check, and locating the resource identifier for a sensitive field.
Use cases:
-
Allow only specific roles or users to view a sensitive field, such as a salary or ID number field.
-
Grant or revoke view permission for a field to multiple users in a single operation.
-
Query the current authorization records and permission operation logs for a table or field.
-
Check whether a user has view permission for a specific field.
Limitations: Before you grant or revoke a column-level permission, you must first locate the field's resource identifier; you cannot do so using only the field or table name. A successful authorization does not guarantee immediate visibility across all query paths. Actual visibility depends on approvals, cache synchronization, and engine-side authorization. Revoking a field's permission is a write operation that may affect dependent tasks, data services, or reports. The code agent will typically ask you to confirm the potential impact before execution.
Prerequisites
-
You have the target tenant ID.
-
The current caller has permission to manage resource permissions.
-
Before granting or revoking permissions, you must locate the resource identifier for the target field. You can typically do this by querying table fields and existing authorization records.
Examples
Use the following example commands directly:
-
List the fields in the employee table and locate the resource identifier for the phone number field.
-
Grant user 'Zhang San' view permission for the salary field in the employee table, with an expiration date at the end of 2026.
-
Query the current field authorization records for the employee table.
-
Check if user 'Li Si' has view permission for the ID card number field.
-
Revoke the view permission of user 'Wang Wu' for the salary field.
-
Query the recent permission operation logs for the salary field.
Interaction steps:
-
The code agent typically starts by confirming the target tenant, asset catalog (business category or workspace), and table name to locate the resource identifier for the target field.
-
Before granting permission, the code agent usually queries existing authorization records to avoid duplicate grants.
-
Before executing a write operation, such as granting or revoking a field permission, the code agent will ask you to confirm the user, field's resource identifier, operation type (usually
SELECT), expiration date, and reason. -
After granting or revoking permission, the code agent usually verifies the result by performing a permission check or querying authorization records or operation logs.
Execution results
After the operation is complete, you will receive the following results:
-
Response content: Authorization and revocation operations return a success or failure message. A permission check returns whether the target user has the specified field permission. Authorization record and operation log queries return their corresponding lists.
-
Completion status: Determined by the success flag returned by the command.
-
Verification: You can verify that the permission has been applied or revoked by running a permission check, querying authorization records, or checking operation logs. Confirm runtime visibility by checking the actual query path.
A success message indicates only that the request was accepted. To confirm the final status, check the Dataphin console.
Input information
The following table lists the information required to manage column-level permissions. In practice, the code agent identifies this information from your commands and prompts you if anything is missing. You do not need to provide items that are not marked as required, as the system generates them.
|
Parameter |
Required |
Description |
Example |
|
Tenant ID |
Conditionally required |
Can be omitted if specified in the credential configuration. |
1234567890123456789 |
|
Asset catalog |
Required to query fields |
The name of the business category or workspace to which the field belongs. |
— |
|
Table name |
Required to query fields |
The name of the table that contains the target field. |
employee |
|
Resource type |
Required for authorization, revocation, and permission checks |
For field permissions, this is typically the physical table field type. |
|
|
Field resource identifier |
Required for authorization, revocation, and permission checks |
The resource ID of the field. You must find this ID to proceed; using only the field or table name is not supported. |
— |
|
User ID |
Required for authorization |
The user whose permissions are being granted, revoked, or checked. |
— |
|
Action Type |
Required for authorization, revocation, and permission checks |
To view a field, the operation type is typically |
|
|
Authorization Validity Period |
Required for authorization |
The date when the authorization expires. |
2026-12-31 |
|
Reason for Granting or Revoking |
No |
A description for auditing purposes. |
— |