Row level security editor

The RLS step of a table popup is where a Lake or Warehouse table gets its row level security: rules that decide which rows each permission group sees. It appears on Warehouse Dimension, Fact, Dictionary, Static and View tables and on Lake staging tables. Use it when different people should see different rows of the same table. For what goes inside a rule, see Row level security rules and operators; for what row level security does and who may change it, see Warehouse permissions and row-level security and Who can do what in the Lake.

The step opens with protection Off, the editor in Auto and no rule blocks. If the table has no permission group yet, it shows Permission Groups Required with a Go to General button; add a permission group on General first.

The three toolbar groups

The step's toolbar groups its controls under three labels:

GroupWhat it holds
ProtectionThe Off/On switch. When On, each permission group only sees rows matching its rules. When Off, every group can access all rows.
ViewRules builds the filters visually, per permission group. SQL previews the generated script or edits it directly in Manual mode.
EditorAuto keeps the SQL in sync with your rules. Manual lets you write the SQL by hand; switching back to Auto discards manual edits.

Turn protection on or off

  1. In the Protection group, click On.
  2. The switch applies straight away, not with the step's save. A spinner replaces the shield while the change is being applied, and both segments are disabled until it finishes.
  3. A toast confirms it: RLS enabled successfully or RLS disabled successfully. If the change fails, the switch returns to its previous position and an Error toast reads Failed to toggle RLS.

While protection is Off, the step shows only the switch and the message "RLS is off - all permission groups can read every row. Turn protection on to start defining access rules."

Add rule blocks

With protection On, New Query adds a rule block. Its tooltip reads "Add a rule block - each targets permission groups with its own row filter conditions."

Preview or edit the SQL

The View group switches between Rules and SQL.

Write the SQL by hand

Set the Editor group to Manual to type the script yourself.

Work in the expanded view

Expand opens Row Level Security as a two-pane workspace: Access Rules on the left and SQL Preview on the right. The subtitle reads "Build access rules on the left and preview generated SQL on the right. Save when done."

Save the step

Questions, answered

Why can't I click On or Off right now?

The switch is still applying its last change: a spinner replaces the shield, and both segments are disabled until it finishes.

What happens if switching protection fails?

The switch returns to its previous position and an Error toast reads Failed to toggle RLS. Nothing changed; try again.

What does the number next to Rules mean?

It counts the rule blocks you have added. It appears only while at least one block exists.

What do the Preview and Editable labels mean?

Preview marks a script generated for you that you cannot type into. Editable appears when you can edit it: protection is On and the editor is Manual.

Why can't I add a rule block?

New Query is unavailable while the editor is Manual, while protection is Off, and while the protection change is being applied.

Why is the SQL view empty?

The SQL view shows a script generated from your rules, so until at least one condition exists there is nothing to generate. In Manual it shows your own script instead.

Where does Manual mode get its starting script?

From the last generated script. Selecting Manual loads it into the editor, and you edit from there.

Why did I have to confirm switching to Manual?

Because the table already has rule blocks. The dialog reads "Are you sure you want to proceed with this change? This may affect your data integrity." Confirm it to switch, or dismiss it to stay in Auto.

When is my rule set saved?

When you save the step with Apply. The Save in the expanded view only copies your edits back to the step; nothing reaches the table until Apply. Saving replaces the whole rule set at once.

What happens if I close the expanded view without saving?

The workspace asks first: Discard unsaved changes? ("You have unsaved RLS changes. Close without saving?"). Discard closes it and drops the draft; the step keeps its last saved state.

Why can't I expand the step?

While protection is Off, the step shows only the protection switch and the off message, so the toolbar actions, including Expand, are not there. Turn protection On.