From 99c3ac170d4100005cba02eaff15486d3e4dc505 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Fri, 23 Dec 2022 15:26:39 -0330 Subject: [PATCH 1/3] Show warning when rls is turned off --- .../SidePanelEditor/TableEditor/TableEditor.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx index baa02b2921d..dcfe815c680 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx @@ -212,15 +212,26 @@ const TableEditor: FC = ({ // @ts-ignore description={ <> - Restrict access to your table by enabling RLS and writing Postgres policies. -
- If RLS is not enabled, anyone with the anon key can modify and delete your data. +

+ Restrict access to your table by enabling RLS and writing Postgres policies. +

+ +

+ If RLS is not enabled, anyone with the anon key can modify and delete your data. +

+ {!tableFields.isRLSEnabled && ( +

+ Turning off RLS means that you are allowing anonymous access to your + table. +

+ )} } checked={tableFields.isRLSEnabled} onChange={() => onUpdateField({ isRLSEnabled: !tableFields.isRLSEnabled })} size="medium" /> + Date: Fri, 23 Dec 2022 15:28:03 -0330 Subject: [PATCH 2/3] Remove transition --- .../TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx index dcfe815c680..68275f1fb57 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx @@ -220,7 +220,7 @@ const TableEditor: FC = ({ If RLS is not enabled, anyone with the anon key can modify and delete your data.

{!tableFields.isRLSEnabled && ( -

+

Turning off RLS means that you are allowing anonymous access to your table.

From 1f71b6dcfefa7b696b1b03f3ee398303a748efc6 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Sat, 24 Dec 2022 14:54:36 +0700 Subject: [PATCH 3/3] Update RLS warning --- .../SidePanelEditor/TableEditor/TableEditor.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx index 68275f1fb57..09928532ab9 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx @@ -1,6 +1,6 @@ import { FC, useEffect, useState } from 'react' import { isUndefined, isEmpty } from 'lodash' -import { Badge, Checkbox, SidePanel, Input } from 'ui' +import { Badge, Checkbox, SidePanel, Input, Alert } from 'ui' import { PostgresTable, PostgresType } from '@supabase/postgres-meta' import { useStore } from 'hooks' @@ -220,10 +220,17 @@ const TableEditor: FC = ({ If RLS is not enabled, anyone with the anon key can modify and delete your data.

{!tableFields.isRLSEnabled && ( -

- Turning off RLS means that you are allowing anonymous access to your - table. -

+ + Turning off RLS means that you are allowing anonymous access to your table + + } + /> )} }