RLSTesterPreview.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { useParams } from 'common'
  2. import Image from 'next/image'
  3. import { InlineLink } from '@/components/ui/InlineLink'
  4. import { BASE_PATH } from '@/lib/constants'
  5. export const RLSTesterPreview = () => {
  6. const { ref } = useParams()
  7. return (
  8. <div className="flex flex-col gap-2">
  9. <p className="text-foreground-light text-sm mb-4">
  10. Verify if your RLS policies have been set up properly by running queries as a specific user.
  11. While role impersonation isn't a new feature on the dashboard, we've built a dedicated UI
  12. for this which will also show what policies are evaluated for the query.
  13. </p>
  14. <Image
  15. src={`${BASE_PATH}/img/previews/rls-tester-preview.png`}
  16. width={1296}
  17. height={900}
  18. quality={100}
  19. alt="rls-tester-preview"
  20. className="rounded-sm border"
  21. />
  22. <div className="space-y-2 mt-4!">
  23. <p className="text-sm">Enabling this preview will:</p>
  24. <ul className="list-disc pl-6 text-sm text-foreground-light space-y-1">
  25. <li>
  26. Show the "Test" button on the{' '}
  27. <InlineLink href={`/project/${ref}/auth/policies`}>
  28. Authentication Policies page
  29. </InlineLink>
  30. </li>
  31. </ul>
  32. </div>
  33. </div>
  34. )
  35. }