Files
Joshen Lim 1de298ff31 Reinstate https://github.com/supabase/supabase/pull/45143 into latest master (#47433)
## Context

Previous PR was [here](https://github.com/supabase/supabase/pull/45143)
but it got stale with lots of conflicts so figured it'll be easier redo
it off the latest master

Moves policies page from Auth to Database under an Access Control
section along with Roles. This moves all existing files, applies
redirects, and updates urls to point to the new route

<img width="274" height="412" alt="image"
src="https://github.com/user-attachments/assets/7952c185-64ae-4355-ba36-45397efe1787"
/>

<img width="453" height="471" alt="image"
src="https://github.com/user-attachments/assets/04b3dcb3-48a5-4049-9893-d01109fb46a9"
/>


## To test
- [ ] Verify that policies now live under Database correctly

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a quick navigation shortcut to open **Database > Policies
(RLS)**.
* **Bug Fixes**
* Updated Policies and RLS-related links across the product to open the
**Database policies** area (menus, command palette, context actions,
alerts, and link-outs).
* Added a permanent redirect from the old **auth policies** URL to the
new **database policies** URL.
* **Documentation**
* Updated RLS Dashboard and security checklist instructions to reference
**Database > Policies**.
* **Tests**
  * Adjusted automated tests to validate the new Policies route.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-30 18:49:33 +08:00

39 lines
1.3 KiB
TypeScript

import { useParams } from 'common'
import Image from 'next/image'
import { InlineLink } from '@/components/ui/InlineLink'
import { BASE_PATH } from '@/lib/constants'
export const RLSTesterPreview = () => {
const { ref } = useParams()
return (
<div className="flex flex-col gap-2">
<p className="text-foreground-light text-sm mb-4">
Verify if your RLS policies have been set up properly by running queries as a specific user.
While role impersonation isn't a new feature on the dashboard, we've built a dedicated UI
for this which will also show what policies are evaluated for the query.
</p>
<Image
src={`${BASE_PATH}/img/previews/rls-tester-preview.png`}
width={1296}
height={900}
quality={100}
alt="rls-tester-preview"
className="rounded-sm border"
/>
<div className="space-y-2 mt-4!">
<p className="text-sm">Enabling this preview will:</p>
<ul className="list-disc pl-6 text-sm text-foreground-light space-y-1">
<li>
Show the "Test" button on the{' '}
<InlineLink href={`/project/${ref}/database/policies`}>
Database Policies page
</InlineLink>
</li>
</ul>
</div>
</div>
)
}