feat(operators): allow operators to access assets page (#9095)

* feat(operators): allow operators to access assets page

Adds the "assets" key to workspace operator_settings (defaulting to true
for existing and new workspaces) and toggles the frontend default so the
assets page is visible to operators by default.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* nit: remove settings btn when not available

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Diego Imbert
2026-05-11 18:36:34 +00:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 03e8bc8c14
commit 20ecd904e7
5 changed files with 59 additions and 12 deletions
@@ -0,0 +1,19 @@
-- Remove "assets" key from operator_settings
UPDATE workspace_settings
SET operator_settings = operator_settings - 'assets'
WHERE operator_settings IS NOT NULL
AND operator_settings ? 'assets';
-- Revert the column default
ALTER TABLE workspace_settings
ALTER COLUMN operator_settings SET DEFAULT '{
"runs": true,
"groups": true,
"folders": true,
"workers": true,
"triggers": true,
"resources": true,
"schedules": true,
"variables": true,
"audit_logs": true
}';
@@ -0,0 +1,21 @@
-- Add "assets": true to operator_settings for all workspaces that have operator_settings
-- but don't already have an "assets" key
UPDATE workspace_settings
SET operator_settings = operator_settings || '{"assets": true}'::jsonb
WHERE operator_settings IS NOT NULL
AND NOT operator_settings ? 'assets';
-- Update the column default to include assets
ALTER TABLE workspace_settings
ALTER COLUMN operator_settings SET DEFAULT '{
"runs": true,
"groups": true,
"folders": true,
"workers": true,
"triggers": true,
"resources": true,
"schedules": true,
"variables": true,
"audit_logs": true,
"assets": true
}';
@@ -17,7 +17,7 @@
schedules: true,
resources: true,
variables: true,
assets: false,
assets: true,
triggers: true,
audit_logs: true,
groups: true,
@@ -303,7 +303,6 @@
label: 'Assets',
href: `${base}/assets`,
icon: Pyramid,
disabled: $userStore?.operator,
aiId: 'sidebar-menu-link-assets',
aiDescription: 'Button to navigate to assets'
},
@@ -12,7 +12,13 @@
type AssetKind,
type ListAssetsResponse
} from '$lib/gen'
import { userStore, workspaceStore, userWorkspaces, globalDbManagerDrawer } from '$lib/stores'
import {
userStore,
workspaceStore,
userWorkspaces,
globalDbManagerDrawer,
superadmin
} from '$lib/stores'
import { parseDbInputFromAssetSyntax, pluralize, truncate } from '$lib/utils'
import ExploreAssetButton, {
assetCanBeExplored
@@ -182,15 +188,17 @@
>
See documentation
</Button>
<Button
wrapperClasses="h-fit"
variant={props.data.current?.length === 0 && !props.data.loading
? 'accent'
: 'subtle'}
iconOnly
endIcon={{ icon: SettingsIcon }}
href={props.settingsHref}
/>
{#if !($userStore?.operator || (!$userStore?.is_admin && !$superadmin))}
<Button
wrapperClasses="h-fit"
variant={props.data.current?.length === 0 && !props.data.loading
? 'accent'
: 'subtle'}
iconOnly
endIcon={{ icon: SettingsIcon }}
href={props.settingsHref}
/>
{/if}
</div>
</div>
{#if props.data.current?.length}