fix: offer the access pen unless every covered workspace's role settles the access

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-12-03 12:02:36 +01:00
co-authored by Claude Opus 5.5
parent 5bf1af4c46
commit d77aba98fd
@@ -183,8 +183,11 @@
? workspaceAccess.filter((w) => isTools(w) && !served.includes(w))
: []
)
// A role limit settles the access; a narrower one the client asked for stays editable.
const editable = $derived(served.every((w) => !w.limited) || access !== 'full')
// Narrowing only ever lowers what each workspace gets, so it is offered unless every role limit
// already settles the access; a narrower one the client asked for stays editable.
const editable = $derived(
served.length === 0 || served.some((w) => !w.limited) || access !== 'full'
)
// One tool list per connection: the picked level's, or what a bound workspace leaves.
// A connection bound to a workspace whose role offers scripts and flows as tools lists those.
const runnablesHere = $derived(