fix(datatables): offer cloning a data table under roles where its grants can be replayed

The server clones such a data table and replays the source's owners and grants,
which only the Enterprise Edition does, so the fork wizard hid both clone
options everywhere instead of on a build that cannot replay them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Diego Imbert
2026-09-21 09:45:15 +02:00
co-authored by Claude Opus 5
parent d2480b4bbd
commit eff0adc174
@@ -9,7 +9,7 @@
<script lang="ts">
import { WorkspaceService } from '$lib/gen'
import { workspaceStore, userStore } from '$lib/stores'
import { workspaceStore, userStore, enterpriseLicense } from '$lib/stores'
import { isCloudHosted } from '$lib/cloud'
import { resource } from 'runed'
import Select from '../select/Select.svelte'
@@ -116,8 +116,9 @@
value: 'keep_original',
label: dt.permissioned ? 'Keep original (under roles)' : 'Keep original'
},
// A copy of a data table under roles is refused by the server, so it is not offered.
...(dt.permissioned
// A copy of a data table under roles carries the source's owners and grants,
// which only the Enterprise Edition replays: elsewhere the server refuses it.
...(dt.permissioned && !$enterpriseLicense
? []
: [
{ value: 'schema_only', label: 'Clone schema only' },