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

# Set up row and column access rules for live connections

> Restrict rows and columns by workspace member, preview access, and verify shared dashboards.

Use row-level security (RLS) to control which rows a member can read. Use column-level security (CLS) to control which columns they can read in those rows.

This guide uses **Harbor Supply Demo**, a fictional workspace. Avery Cole from Finance sees NORTH sales and margin. Morgan Lane from Sales sees SOUTH sales and revenue.

## Before you start

* Live access rules require BOW Enterprise and a connection that uses shared system credentials. Supported connectors are Microsoft Fabric, PostgreSQL, Microsoft SQL Server, Oracle, and SQLite.
* To publish, you need **Manage connections** in the workspace and permission to manage the connection. Previewing as another member requires full admin access. [Roles and permissions](https://docs.bow.ai/users/roles-and-permissions.md)
* Map each table you want BOW to query through the protected connection. The source database separately controls any direct access to its data. If you query a shared cached copy using BOW Fast, follow the [BOW Fast row-level security guide](https://docs.bow.ai/bow-fast/row-level-security.md).

## Set up row access

Open **Manage connection → Access rules → Connection mapping**. In the demo, the grant table contains the following rows.

| member\_email | company\_id | source\_table |
| - | - | - |
| [avery@example.com](mailto:avery@example.com) | NORTH | sales |
| [morgan@example.com](mailto:morgan@example.com) | SOUTH | sales |
| [avery@example.com](mailto:avery@example.com) | NORTH | costs |
| [morgan@example.com](mailto:morgan@example.com) | SOUTH | costs |

Each row grants a member one company value for one resource. You can add more rows when a member needs several values.

1. Set the identity to **Verified member email** and the **Member property** to email. For an Entra-based policy, choose **Microsoft Entra** and enter the tenant ID.
2. Set **Grant table** to `access_grants`, **Matching grant column** to `member_email`, and **Granted value column** to `company_id`.
3. Enable **Use a resource type to distinguish grants** and set **Resource type column** to `source_table`.
4. Select **Return to rules**, open `sales`, and choose **Row access**. Set **Column to filter** to `company_id`, **Grant access using** to **Grant table**, and **Resource type value** to `sales`.

![Connection mapping for the fictional Harbor Supply grant table](https://mintcdn.com/bagofwords/tPzcs9zb84hWS486/images/live-access-rules/grant-table-mapping.png?fit=max\&auto=format\&n=tPzcs9zb84hWS486\&q=85\&s=79a3693f4b71c91c522b30b71f443ad8)

Use the exact indexed table names. For example, use `dbo.sales` for a table in the `dbo` schema and `sales` for SQLite. If each member has a property that already contains the value in the table, you can choose **Member property** directly in **Grant access using**.

## Set up column access

1. Open **Column access** on `sales` and enable **Limit visible columns**.
2. Select `company_id`, `order_id`, and `revenue`. Leave their audience set to **Everyone with row access**.
3. Select `margin` and set its audience to **Members matching a property**. In the demo, choose email and enter `avery@example.com` in **Allowed values**. In your workspace you can select an available admin-managed member property, such as department, and match a value such as Finance.

When you enable **Limit visible columns**, unselected and newly added columns stay hidden. A member whose property is missing or has no allowed value cannot see a column restricted by that property.

## Apply row rules to several tables

In **Table access**, select `sales` and `costs`, then click **Apply to selected tables (2)**. Use `company_id` as the shared **Column to filter**. Override the value for `costs` with `billing_company_id`. Check that the resource type values are `sales` and `costs`, respectively.

![Bulk access rules with a separate filter column for costs](https://mintcdn.com/bagofwords/tPzcs9zb84hWS486/images/live-access-rules/bulk-access-rules.png?fit=max\&auto=format\&n=tPzcs9zb84hWS486\&q=85\&s=899611f9469f3040167cc0d87b9a9847)

Bulk edits preserve existing column rules. **Save** validates the whole selection and publishes the rules together.

## Preview and save

Open `sales`, choose a member in **Preview as**, then select **Run preview**. You can preview the current edits before saving. Use the column search in the preview to check an individual column in a wide table.

> [tab] Avery Cole
>
> Avery sees NORTH orders and the `margin` column.
>
> ![Avery Cole's preview with NORTH sales and margin](https://mintcdn.com/bagofwords/tPzcs9zb84hWS486/images/live-access-rules/preview-finance.png?fit=max\&auto=format\&n=tPzcs9zb84hWS486\&q=85\&s=cab848dc3a632133dfc9f5e2d651e82a)

> [tab] Morgan Lane
>
> Morgan sees SOUTH orders. Their visible columns are `company_id`, `order_id`, and `revenue`.
>
> ![Morgan Lane's preview with SOUTH sales and revenue](https://mintcdn.com/bagofwords/tPzcs9zb84hWS486/images/live-access-rules/preview-sales.png?fit=max\&auto=format\&n=tPzcs9zb84hWS486\&q=85\&s=09693427e207e3e3fc9fb97cd2c41b02)

**Save makes the rules live immediately.** If validation fails, fix the mapping shown in the editor and retry. For example, if BOW can't find the filter column on `costs`, check the exact indexed spelling of `billing_company_id`. BOW keeps the last published rules in effect while you correct the edit.

## Verify access and revocation

| Check | What to verify |
| - | - |
| Run the same sales query as both members | Avery gets NORTH and can query `margin`. Morgan gets SOUTH and a query requesting `margin` is denied. |
| Open the agent's read-only **Tables** tab | Each member sees their permitted columns. BOW uses the signed-in member's permitted schema to build the agent prompt. |
| Open the same saved entity and shared dashboard | Use a report based on columns both members can read, such as `company_id` and `revenue`. Each member sees results under their own identity. |
| Revoke Morgan's `sales` grant | Remove Morgan's SOUTH row for `sales` from `access_grants`. Run a fresh query and reopen the saved entity and shared dashboard as Morgan. Verify SOUTH sales no longer appear. Avery should still see NORTH sales. |

Agent managers choose which tables an agent uses. Connection admins publish security rules. A table's inclusion in an agent does not grant the agent's viewers additional row or column access.

> [!NOTE]
>
> The editable agent **Tables** tab can appear empty in a workspace with active live access rules. Use **Access rules → Preview as** and the member's read-only schema to verify their access.


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