> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nx1cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grant a role access to data

> Grant a role access to a catalog, schema, table, or columns to control who can use the data.

Granting a role access to data gives the role an access level on a catalog, schema, table, or columns.
For example, you can give the `nx1_engineer` role the **Read** level on a table, so engineers can query it.

> [!NOTE]
>
> Data means the catalogs, schemas, tables, and columns in the NexusOne catalog. To give access to files in an object
> storage bucket, refer to [Grant a role access to a storage location](https://docs.nx1cloud.com/documentation/govern/tasks/data-access/role-access/grant-a-role-access-to-a-storage-location.md).

## Prerequisites

Before starting this task, ensure you have the following:

Required roles: `nx1_migration_admin` or `nx1_migration_ops`.

## Grant a role access to data

> [tab] Web portal
>
> Perform these steps to grant a role access to data.
>
> 1. Log in to NexusOne.
>
> 2. On the top navigation bar, hover your mouse over **Govern** and then select **Data Access**.
>
> 3. Click the **Grant access** tab.
>
> 4. Under **Who**, in the **Groups** field, select the role to give access to. Roles appear as groups.
>
> 5. Optional: In the **Users** field, select the users to give access to.
>
> 6. Under **On what**, click **Data**.
>
> 7. Select the data:
>
>    * **Catalog**: Select the catalog.
>    * **Schema**: Select the schema. If you leave it empty, then the access covers every schema in the catalog.
>    * **Table**: Select the table. If you leave it empty, then the access covers every table in the schema.
>    * **Columns**: Select the columns. This field appears after you select a table. If you leave it empty,
>      then the access covers every column.
>
> 8. Under **Access level**, select the level to grant. For what each level includes, refer to
>    [Access levels](https://docs.nx1cloud.com/documentation/govern/overview.md#access-levels).
>
> 9. Optional: After you select a table, under **Conditions**, limit the access:
>
>    * Click **Hide a column**. In the new row, select the column in the first dropdown. The second dropdown
>      offers the following ways to hide the column's values:
>
>      * **Custom**: Applies a custom masking expression from Ranger.
>      * **Hash**: Replaces the value with its hash.
>      * **Nullify**: Replaces the value with null.
>      * **Partial mask: show first 4**: Hides all but the first four characters.
>      * **Partial mask: show last 4**: Hides all but the last four characters.
>      * **Redact**: Replaces the value with a placeholder character.
>      * **Unmasked**: Keeps the original value.
>
>      To hide more columns, click **Hide a column** again.
>
>    * In the **Only rows where** field, enter a SQL condition, such as `region = 'EU'`, to limit the rows.
>
> 10. Optional: In the **Why** field, enter who asked for the access and what it is for.
>
> 11. Click **Preview** to see the policies the grant writes and whose access changes.
>
> 12. Click **Apply**.

> [tab] REST API
>
> Use the following API endpoints to:
>
> * [List access levels](https://docs.nx1cloud.com/api-reference/endpoints/data-access/list-access-levels-and-the-ranger-access-types-behind-each.md).
> * [Preview a grant](https://docs.nx1cloud.com/api-reference/endpoints/data-access/preview-a-grant:-the-policies-it-writes-and-whose-access-changes.md).
> * [Apply a grant](https://docs.nx1cloud.com/api-reference/endpoints/data-access/apply-a-grant.md) with data as the target.

## Additional resources

* For an overview of the Govern feature, refer to [Govern Overview](https://docs.nx1cloud.com/documentation/govern/overview.md).
* You can also grant this access directly in Ranger. For the steps, refer to
  [Create a policy](https://docs.nx1cloud.com/platform-components/apache-ranger/ranger-hands-on-examples.md#create-a-policy).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.