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

# Policies

> The **Policies** tab on the ***Roles & Policies*** page gives Administrators a centralized, rule-based framework to govern who can access what data and at what granularity.

Policies control which data users and system roles can access in Connect AI. You can grant access to sources and virtual schemas, and tailor each policy down to individual tables, views, and stored procedures. You can also set the specific access each one allows, such as select, insert, update, and delete for tables and views, and execute for stored procedures. For example, you can give a system role read-only access to some tables while allowing another system role to update them.

> [!NOTE]
>
> * Access roles are being replaced by policies. System roles remain available and continue to determine administrative privileges. You can assign policies to users, system roles, and SCIM groups (if SCIM groups are provisioned). See [Roles](https://docs.cloud.cdata.com/en/Roles-Policies/Roles.md) and [SCIM Groups](https://docs.cloud.cdata.com/en/SCIM/SCIM-Groups.md) for more information.
>
> * Only Administrators can add or modify policies. Each policy applies to a single workspace.

![Policies list](https://mintcdn.com/cdata/UcBWyV3N_YdbeIpn/en/images/policies.png?fit=max\&auto=format\&n=UcBWyV3N_YdbeIpn\&q=85\&s=378cf7ffb4e76224f3d05cb721ac40ef)

The **Policies** tab contains the following information:

* A search bar to search for a policy by name.
* A status filter to filter for **Active** or **Inactive** policies.
* A row for every policy in your account:
  * **Name** is the policy name.
  * **Status** is the status of the policy (**Active** or **Inactive**). Use the toggle in the **Status** column to set a policy to **Active** or **Inactive**. Deactivating a policy takes effect within about a minute.
  * **Type** is the type of policy (only **Data access** is currently available).
  * **Access** is the type of access that the policy grants, including **Sources** and **Virtual Schemas**, and the number of each source and schema in the policy.
  * **Assignments** is the type of assignment to the policy, including **Users** and **Roles** (system roles), and the number assigned to the policy.
  * **Last Modified** is the date and time the policy was last modified.

## Add a Policy

**Step 1**

In the **Policies** tab of the **Roles & Policies** page, click **+ Add Policy**.

**Step 2**

In **Step 1: Details**, enter the **Policy Name**.

**Step 3**

(Optional) Enter a short **Description** of the policy that appears in the **Policies** list.

**Step 4**

Select a **Policy Type** (only **Data access** is currently available).

![Add Policy](https://mintcdn.com/cdata/UcBWyV3N_YdbeIpn/en/images/policies_add_policy.png?fit=max\&auto=format\&n=UcBWyV3N_YdbeIpn\&q=85\&s=7f0aa3eda020e9dd473e63d2141feb5d)

**Step 5**

Click **Next**.

**Step 6**

In **Step 2: Configuration**, select a **Workspace** to apply the policy to. Click the **Sources** and **Virtual Schemas** tabs to view the data sources and virtual schemas for the selected workspace.

**Step 7**

Toggle on the sources and virtual schemas that the policy can access. You can fine-tune access to tables, views, and stored procedures after you create the policy.

![Policy Configuration](https://mintcdn.com/cdata/UcBWyV3N_YdbeIpn/en/images/policies_config.png?fit=max\&auto=format\&n=UcBWyV3N_YdbeIpn\&q=85\&s=e05d3bdc0a238df6b409b94d2cc44bf0)

**Step 8**

Click **Next**.

**Step 9**

In **Step 3: Assignments**, select the users, system roles, and groups (if SCIM groups are enabled) to assign to the policy. Everyone who holds an assigned role or belongs to an assigned group gets the access that the policy grants. The Administrator role does not appear in the **Roles** tab because it already has full access. You must assign each active policy to at least one user, system role, or group.

![Assign Policy](https://mintcdn.com/cdata/UcBWyV3N_YdbeIpn/en/images/policies_assign.png?fit=max\&auto=format\&n=UcBWyV3N_YdbeIpn\&q=85\&s=42984b28cda13e76fec7a08f11fd48fe)

**Step 10**

Click **Add Policy**. The new policy appears in the **Policies** list.

## Edit a Policy

After you create a policy, you can edit the policy to fine-tune the tables, views, and stored procedures that the policy allows. You can also edit the **Policy Name**, **Description**, source and virtual schema access, and policy assignments.

A policy's edit page has a **Details** section at the top, followed by the following tabs: **Source Access**, **Virtual Schema Access**, and **Assignments**.

To fine-tune a policy for sources and virtual schemas:

**Step 1**

Click a policy to open its edit page.

**Step 2**

Click the **Source Access** tab. For each source that is toggled on, select the **Schema** (if there is more than one). Then choose the individual tables, views, and stored procedures that the policy grants access to. You can also select the level of access for each entity. See [Access Levels](#access-levels).

![Policies Source Access](https://mintcdn.com/cdata/UcBWyV3N_YdbeIpn/en/images/policies_source_access.png?fit=max\&auto=format\&n=UcBWyV3N_YdbeIpn\&q=85\&s=71e9d3af2c4b357db905919b87d0515f)

> [!NOTE]
>
> If the **Default Connection & Virtual Schema Permissions** setting is **Select Only**, **Select** is selected for each table and view by default. You can deselect tables and views that do not apply. Stored procedures are never selected by default. See [Security](https://docs.cloud.cdata.com/en/Settings/Security.md) for details.

**Step 3**

Click the **Virtual Schema Access** tab. For each virtual schema that is toggled on, choose the individual tables, views, and stored procedures that the policy grants access to. You can also select the level of access for each entity. See [Access Levels](#access-levels).

**Step 4**

Click **Save** at the top of the policy's edit page to save the policy changes.

To edit the policy name, description, or assignments:

**Step 1**

Click a policy to open its edit page.

**Step 2**

In the **Details** section at the top of the page, edit the **Policy Name** or **Description**.

**Step 3**

Click the **Assignments** tab and select or clear the users and system roles assigned to the policy.

**Step 4**

Click **Save** at the top of the policy's edit page to save the policy changes.

## Access Levels

For each table and view, you can grant any combination of the following access levels:

* **Read**–Query and read data.
* **Create**–Add new records.
* **Write**–Modify existing records.
* **Delete**–Remove records.

For each stored procedure, you can grant **Execute** access, which allows users to run the procedure.

> [!NOTE]
>
> Insert, update, and delete access on a view depends on whether the underlying data source supports those operations through the view.

## How Policies Combine

Policies are additive. When more than one active policy applies to a user, the user has the combined access granted by all of those policies. For example, if one policy grants select access to a table and another policy grants insert access to the same table, the user has both select and insert access.

## Delete a Policy

**Step 1**

In the **Policies** list, select the policy you want to delete.

**Step 2**

In the policy's edit page, click **Delete Policy**.

**Step 3**

Click **Delete** in the dialog to confirm.

The deletion is permanent. Users and system roles assigned to the policy lose the access that the policy granted, unless another active policy also grants it.


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