mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-12-03 16:10:37 +00:00
fix: read a role's instance mcp limit only from its own key
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
67701383bb
commit
1405657a21
@@ -62,9 +62,15 @@
|
||||
|
||||
function overriddenKeys(o: RoleOverride | undefined): string[] {
|
||||
const c = o?.capabilities ?? {}
|
||||
const keys = ['code', 'flows', 'apps', 'manage_schedules', 'manage_triggers', 'run', 'fork'].filter(
|
||||
(k) => c[k] != null
|
||||
)
|
||||
const keys = [
|
||||
'code',
|
||||
'flows',
|
||||
'apps',
|
||||
'manage_schedules',
|
||||
'manage_triggers',
|
||||
'run',
|
||||
'fork'
|
||||
].filter((k) => c[k] != null)
|
||||
for (const { key } of VISIBILITY_KEYS) {
|
||||
if (c.visibility?.[key] != null) keys.push(`visibility.${key}`)
|
||||
}
|
||||
@@ -181,9 +187,7 @@
|
||||
|
||||
/** Whether saving makes `run` of `name` fall back to an unknown instance value. */
|
||||
function runUnknown(name: string): boolean {
|
||||
return (
|
||||
baseFor(name).unknown.includes('run') && draft.get(name)?.capabilities?.run == null
|
||||
)
|
||||
return baseFor(name).unknown.includes('run') && draft.get(name)?.capabilities?.run == null
|
||||
}
|
||||
|
||||
function setLabel(name: string, label: string) {
|
||||
@@ -325,7 +329,9 @@
|
||||
{#if data?.custom_roles_enabled || role?.mcp || draft.get(name)?.mcp}
|
||||
<RoleMcpAccessEditor
|
||||
setting={draft.get(name)?.mcp}
|
||||
instanceLimit={role && data?.instance_mcp[name]}
|
||||
instanceLimit={role && data && Object.hasOwn(data.instance_mcp, name)
|
||||
? data.instance_mcp[name]
|
||||
: undefined}
|
||||
canRun={runUnknown(name) ? undefined : caps.run}
|
||||
{workspace}
|
||||
frozen={!data?.custom_roles_enabled}
|
||||
|
||||
Reference in New Issue
Block a user