diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx index 5d64819ee49..ae34fb099d4 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx @@ -58,13 +58,16 @@ const PolicyRow = ({ Applies to anonymous users ) : null} -
-

Applied to:

- {policy.roles.slice(0, 3).map((role, i) => ( - - {role} - - ))} +
+
+ Applied to: + {policy.roles.slice(0, 3).map((role, i) => ( + + {role} + + ))}{' '} + role +
{policy.roles.length > 3 && ( diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx index a257f77b445..4fac00d72db 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx @@ -1,7 +1,7 @@ import type { PostgresTable } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { noop } from 'lodash' -import { Lock } from 'lucide-react' +import { Lock, Unlock } from 'lucide-react' import Link from 'next/link' import { useRouter } from 'next/router' @@ -36,7 +36,16 @@ const PolicyTableRowHeader = ({ return (
- + + {table.rls_enabled ? ( +
+ +
+ ) : ( +
+ +
+ )}

{table.name}

@@ -47,9 +56,6 @@ const PolicyTableRowHeader = ({ )} - - {table.rls_enabled ? 'Row Level Security enabled' : 'Row Level Security disabled'} -
{!isTableLocked && ( diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx index 3677574f2b5..fd895d66bda 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx @@ -1,11 +1,11 @@ import type { PostgresPolicy, PostgresTable } from '@supabase/postgres-meta' import { noop } from 'lodash' -import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_ } from 'ui' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' -import { WarningIcon } from 'ui' import Panel from 'components/ui/Panel' import { useDatabasePoliciesQuery } from 'data/database-policies/database-policies-query' +import { Info } from 'lucide-react' +import { cn, Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui' import PolicyRow from './PolicyRow' import PolicyTableRowHeader from './PolicyTableRowHeader' @@ -47,38 +47,34 @@ const PolicyTableRow = ({ /> } > - {(!table.rls_enabled || policies.length === 0) && ( -
- {table.rls_enabled && policies.length === 0 && ( - - - - Row Level Security is enabled for this table, but no policies are set - - - Select queries may return 0 results. - - - )} - {!table.rls_enabled && !isLocked && ( - - - - Warning: Row Level Security is disabled. Your table is publicly readable and - writable. - - - Anyone with the project's anonymous key can modify or delete your data. Enable RLS - and create access policies to keep your data secure. - - - )} - {policies.length === 0 && ( -

No policies created yet

+ {!table.rls_enabled && !isLocked && ( +
+
+ Warning:{' '} + + Row Level Security is disabled. Your table is publicly readable and writable. + + + + + + + Anyone with the project's anonymous key can modify or delete your data. Enable RLS and + create access policies to keep your data secure. + + +
+ )} + {policies.length === 0 && ( +
+

No policies created yet

)} - {policies?.map((policy) => (