+ When enabled, users without a matching grant lose all access to this data table
+ (default deny), including from scripts and flows they run. Workspace admins and
+ superadmins are unaffected and keep full access. Access is enforced by PostgreSQL
+ itself through short-lived per-user roles.
+
+
+ Grants ({perms.grants?.length ?? 0})
+
+ Each grant gives a user, a group, or the users of a folder a set of SQL operations
+ on a schema or on specific tables. A user's effective access is the union of all
+ matching grants.
+
+
+
+
+ {#if (perms.grants ?? []).length === 0}
+
+ No grants: only admins can access this data table while permissions are enabled.
+
+ {/if}
+ {#each perms.grants ?? [] as grant, i (i)}
+
+
+ {#if isExternalDb}
+
+ Enabling permissions makes Windmill create and drop PostgreSQL roles on the fly
+ on your external database server (its user needs the
+ CREATEROLE privilege). These short-lived roles can also connect to other databases on that
+ server that still grant CONNECT to PUBLIC (the PostgreSQL default) — revoke it there if
+ that matters to you.
+
+ {/if}
+
+
+
+
+ Grants are enforced by PostgreSQL through short-lived per-user roles; schema usage
+ and sequence usage (for INSERT/UPDATE) are granted automatically.
+
+
+ A grant with no table selected covers the whole schema including tables created
+ later; table-specific grants only cover the listed tables.
+
+
+ DDL (CREATE/ALTER/DROP) is never grantable: schema changes go through migrations,
+ which become admin-only when permissions are enabled.
+
+
+ Changes to grants, groups or folders take effect on the next access; a connection
+ already open keeps its privileges for up to 5 minutes.
+
+
+ Creating or editing Postgres triggers on this data table, and running its
+ migrations, require workspace admin while permissions are enabled.
+
+
+
+
+ {/if}
+
+
+{/if}
diff --git a/frontend/src/lib/components/workspaceSettings/DataTableSettings.svelte b/frontend/src/lib/components/workspaceSettings/DataTableSettings.svelte
index f652ed8704..1e56df5f80 100644
--- a/frontend/src/lib/components/workspaceSettings/DataTableSettings.svelte
+++ b/frontend/src/lib/components/workspaceSettings/DataTableSettings.svelte
@@ -78,6 +78,7 @@
import { Popover } from '../meltComponents'
import ExploreAssetButton from '../ExploreAssetButton.svelte'
import DataTableMigrationsButton from './DataTableMigrationsButton.svelte'
+ import DataTablePermissionsButton from './DataTablePermissionsButton.svelte'
import { deepEqual } from 'fast-equals'
import { clone } from '$lib/utils'
import SettingsFooter from './SettingsFooter.svelte'
@@ -300,6 +301,11 @@