Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Chore/enable rls by default (#9690)

Terry Sutton56ab5eea8226
diff --git a/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx b/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
index 591e3a13590..829ea337b80 100644
--- a/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
+++ b/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
@@ -31,7 +31,9 @@ const GridHeaderActions: FC<Props> = ({ table }) => {
{/* RLS {table.rls_enabled ? 'is' : 'not'} enabled */}
{!table.rls_enabled
? 'RLS is not enabled'
- : `${policies.length} active RLS polic${policies.length > 1 ? 'ies' : 'y'}`}
+ : `${policies.length == 0 ? 'No' : policies.length} active RLS polic${
+ policies.length > 1 || policies.length == 0 ? 'ies' : 'y'
+ }`}
</Button>
</a>
</Link>
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts
index b17c714db37..6c148727289 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts
@@ -29,7 +29,7 @@ export const generateTableField = (): TableField => {
name: '',
comment: '',
columns: DEFAULT_COLUMNS,
- isRLSEnabled: false,
+ isRLSEnabled: true,
isRealtimeEnabled: false,
}
}