Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update policy page to show applied roles instead of using/check statemnet

Joshen Limecf6b504f2d6
diff --git a/studio/components/interfaces/Authentication/Policies/PolicyTableRow/PolicyRow.tsx b/studio/components/interfaces/Authentication/Policies/PolicyTableRow/PolicyRow.tsx
index 8170c6e3284..d1d9634c4d3 100644
--- a/studio/components/interfaces/Authentication/Policies/PolicyTableRow/PolicyRow.tsx
+++ b/studio/components/interfaces/Authentication/Policies/PolicyTableRow/PolicyRow.tsx
@@ -14,21 +14,27 @@ const PolicyRow: FC<Props> = ({
onSelectEditPolicy = () => {},
onSelectDeletePolicy = () => {},
}) => {
+ console.log('Policy', policy)
return (
<Panel.Content
className={[
'border-panel-border-light dark:border-panel-border-dark flex',
- 'w-full gap-4 border-b py-4 lg:items-center',
+ 'w-full space-x-4 border-b py-4 lg:items-center',
].join(' ')}
>
- <div className="text-scale-900 font-mono text-xs">{policy.command}</div>
- <div className="flex grow flex-col gap-2 truncate lg:flex-row">
- <span className="text-scale-1200 max-w-xs truncate text-sm">{policy.name}</span>
- <span className="text-scale-1100 truncate text-sm">
- {policy.definition || policy.check}
- </span>
+ <div className="flex grow flex-col truncate space-y-1">
+ <div className="flex items-center space-x-4">
+ <p className="text-scale-1000 font-mono text-xs">{policy.command}</p>
+ <p className="text-scale-1200 max-w-xs truncate text-sm">{policy.name}</p>
+ </div>
+ <div className="flex items-center space-x-2">
+ <p className="text-scale-1000 text-sm">Applied to:</p>
+ {policy.roles.map((role) => (
+ <code className="text-scale-1000 text-xs">{role}</code>
+ ))}
+ </div>
</div>
- <div className="">
+ <div>
<Dropdown
side="bottom"
align="end"