The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: display FGA permission groups with OR logic (#42438)
Hieudac2ff0aaa7c
diff --git a/apps/docs/features/docs/Reference.sections.tsx b/apps/docs/features/docs/Reference.sections.tsxindex a3f17c83513..c71510e1032 100644--- a/apps/docs/features/docs/Reference.sections.tsx+++ b/apps/docs/features/docs/Reference.sections.tsx@@ -1,20 +1,5 @@-import { isFeatureEnabled } from 'common'-import { Fragment } from 'react'-import ReactMarkdown from 'react-markdown'-import {- Badge,- TabsContent_Shadcn_,- TabsList_Shadcn_,- TabsTrigger_Shadcn_,- Tabs_Shadcn_,- cn,-} from 'ui'--import { type IApiEndPoint } from './Reference.api.utils'-import { RefInternalLink } from './Reference.navigation.client'-import { ApiOperationBodySchemeSelector } from './Reference.ui.client'import ApiSchema from '~/components/ApiSchema'-import { REFERENCES, clientSdkIds } from '~/content/navigation.references'+import { clientSdkIds, REFERENCES } from '~/content/navigation.references'import {getApiEndpointById,getCliSpec,@@ -23,7 +8,7 @@ import {getSelfHostedApiEndpointById,getTypeSpec,} from '~/features/docs/Reference.generated.singleton'-import { MDXRemoteRefs, getRefMarkdown } from '~/features/docs/Reference.mdx'+import { getRefMarkdown, MDXRemoteRefs } from '~/features/docs/Reference.mdx'import type { MethodTypes } from '~/features/docs/Reference.typeSpec'import { formatMethodSignature } from '~/features/docs/Reference.typeSpec'import {@@ -38,6 +23,21 @@ import {import type { AbbrevApiReferenceSection } from '~/features/docs/Reference.utils'import { normalizeMarkdown } from '~/features/docs/Reference.utils'import { CodeBlock } from '~/features/ui/CodeBlock/CodeBlock'+import { isFeatureEnabled } from 'common'+import { Fragment } from 'react'+import ReactMarkdown from 'react-markdown'+import {+ Badge,+ cn,+ Tabs_Shadcn_,+ TabsContent_Shadcn_,+ TabsList_Shadcn_,+ TabsTrigger_Shadcn_,+} from 'ui'++import { type IApiEndPoint } from './Reference.api.utils'+import { RefInternalLink } from './Reference.navigation.client'+import { ApiOperationBodySchemeSelector } from './Reference.ui.client'type RefSectionsProps = {libraryId: string@@ -286,8 +286,10 @@ async function ApiEndpointSection({ link, section, servicePath }: ApiEndpointSec: await getApiEndpointById(section.id)if (!endpointDetails) return null- const endpointFgaPermissions =- endpointDetails.security?.find((sec) => 'fga_permissions' in sec)?.fga_permissions ?? []+ const endpointFgaPermissionGroups =+ endpointDetails.security+ ?.filter((sec) => 'fga_permissions' in sec)+ .map((sec) => sec.fga_permissions) ?? []const pathParameters = (endpointDetails.parameters ?? []).filter((param) => param.in === 'path')const queryParameters = (endpointDetails.parameters ?? []).filter((param) => param.in === 'query')const bodyParameters =@@ -360,16 +362,23 @@ async function ApiEndpointSection({ link, section, servicePath }: ApiEndpointSec</ul></section>)}- {endpointFgaPermissions.length > 0 && (+ {endpointFgaPermissionGroups.length > 0 && (<section><h3 className="mb-3 text-base text-foreground">The fine-grained token must include the following permissions to access this endpoint:</h3><ul>- {endpointFgaPermissions.map((perm) => (- <li key={perm} className="list-['-'] ml-2 pl-2">- <span className="font-mono text-sm font-medium text-foreground">{perm}</span>- </li>+ {endpointFgaPermissionGroups.map((group, groupIndex) => (+ <Fragment key={groupIndex}>+ {groupIndex > 0 && (+ <li className="my-2 text-foreground-lighter text-sm italic">or</li>+ )}+ {group.map((perm, permIndex) => (+ <li key={permIndex} className="list-['-'] ml-2 pl-2">+ <span className="font-mono text-sm font-medium text-foreground">{perm}</span>+ </li>+ ))}+ </Fragment>))}</ul></section>