diff --git a/frontend/src/lib/components/settings/RoleMcpAccessEditor.svelte b/frontend/src/lib/components/settings/RoleMcpAccessEditor.svelte index 19f58a09df..df9046d88e 100644 --- a/frontend/src/lib/components/settings/RoleMcpAccessEditor.svelte +++ b/frontend/src/lib/components/settings/RoleMcpAccessEditor.svelte @@ -46,20 +46,22 @@ const effective = $derived(setting ?? instanceLimit) const limited = $derived(effective != undefined && effective.access !== 'follow_role') - // Not below what the role can already do. One that is stored stays selectable, with a hint. - const runRedundant = $derived(canRun === false && setting?.access !== 'read_run') + // Both run, so a role that cannot run gets nothing from them. One that is stored stays + // selectable, with a hint. + const RUNS = ['read_run', 'runnables'] + const runRedundant = (value: string) => + canRun === false && RUNS.includes(value) && setting?.access !== value const items = $derived([ ...(instanceLimit ? [{ value: INHERIT, label: inheritedLabel(instanceLimit) }] : []), ...Object.entries(MCP_ROLE_LIMIT_LABELS) .filter( - ([value]) => - value === setting?.access || (!frozen && (workspace || value !== 'runnables')) + ([value]) => value === setting?.access || (!frozen && (workspace || value !== 'runnables')) ) .map(([value, label]) => ({ value, label, - ...(value === 'read_run' && runRedundant + ...(runRedundant(value) ? { disabled: true, subtitle: 'This role cannot run scripts and flows' } : {}) })) @@ -142,10 +144,14 @@ bind:value={() => setting?.access ?? INHERIT, (v) => v && setAccess(v)} /> - {#if effective?.access === 'read_run' && canRun === false} + {#if canRun === false && effective?.access === 'read_run'} This role cannot run scripts and flows, so its members get read only. + {:else if canRun === false && effective?.access === 'runnables'} + + This role cannot run scripts and flows, so its members get no tools. + {/if} {/if} {#if setting?.access === 'runnables'}