* feat: cap mcp access per workspace role Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep read-and-run tools under a selection, audit capped calls Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: no hub scripts under an mcp limit, count role changes once stored Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: choose mcp scripts and flows per workspace, not on instance roles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: limit mcp access of a role with a toggle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: point ee ref at the companion merged with ee main Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: read a role's instance mcp limit only from its own key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: disable scripts and flows as tools on a role that cannot run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: approve-only mcp connect page showing per-workspace access Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: name only what a connection gets, refuse scoped callers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * style: align the limit access fold Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: show the access the server gives, keep picked workspaces Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: name what a non-authoring role edits over mcp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep the workspace picked under a selection, cap the tool count query Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: show what a role limit leaves a new mcp token Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: preview a token's mcp access with its superadmin rights Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: show the mcp consent page's access per workspace, edit it in a dialog Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: bind a tools-only connection to its workspace, list a run-and-edit role's full tools Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: shorten the run-and-edit access label, list the edits in its tooltip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: name a non-authoring role's access build and run, with a restricted badge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: name the workspace that connects on its own, set its two ways apart Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: bold title and two subheaders for a workspace that connects on its own Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: list the one toolset a connection gets, trimmed only for a bound workspace Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: one tool list per connection, fold the workspaces that connect on their own Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: show the consent page's tools in a searchable dialog, pick the access from a select Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: one access select in the token form and the consent page, workspace url beside /api/mcp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: one per-workspace access list on the consent page and token forms, in place of the narrowing alert Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: list a role's scripts and flows as tools on the consent page, restricted badge before the access Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep withheld admin rights in the tools preview, name what a partial author or the deploy rules hold back Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: refuse the tools preview to a token withholding superadmin rights, restricted badge after a single access line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: workspace line before the token form's access, one workspace's access as a line, plainer hints Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: preview tools with the rights the credential carries, one access section shared by the consent page and token forms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: list a role's runnable tools under the workspace route, authenticated there as any workspace call Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: put the consent page's pens next to their section titles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: leave a tools workspace out of a read-only connection's list and say why in its card, select it from the card Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep one row and url per workspace that connects separately Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: offer the access pen unless every covered workspace's role settles the access Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: mcp token form reaches every workspace by default, editable everywhere; plain generated-token card Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: one not-included card for tools workspaces on the consent page and token forms, global mcp url label Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: close the consent page's card markup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: show the not-included card under the workspaces it is about Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: quiet show tools action at the right of the access title Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: one access line on the mcp consent page, limit access capped at it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: same access line on the mcp token forms as on the consent page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: mcp tool listing reckons access as the consent page does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: token form shows the tools the connection lists, drop the old toolset guess Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: one mcp access check for calls, tool listing and the consent page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: pens next to the workspace and access values on the mcp consent page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: limit access dialog keeps the clamped level when it opens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: mcp refusal names the workspace and what the session can do there Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: no limit pen on a tools workspace, stricter-of note in the limit dialog Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: one sentence for the role cap on the mcp page, dialog and token form Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: role mcp access as a select with what members get and the urls to share Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: name the top mcp level everything your role allows; keep the pen for a requested selection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep read only for a role that cannot run, which still holds its admins Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: tools workspaces selectable for a selection, one full-access label for external clients Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: workspace role mcp access always starts from the instance's setting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: a stored read only holds admins too in the members-get line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep the limit pen once a selection is made on a tools workspace Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: update ee-repo-ref to 4a19159ab6f634de29673aa530b76d9a9710ab78 This commit updates the EE repository reference after PR #1033 was merged in windmill-ee-private. Previous ee-repo-ref: 8317dbf5116aaca61acfe2f20e4c2340b3f17377 New ee-repo-ref: 4a19159ab6f634de29673aa530b76d9a9710ab78 Automated by sync-ee-ref workflow. * chore: update ee-repo-ref to 4a19159ab6f634de29673aa530b76d9a9710ab78 This commit updates the EE repository reference after PR #1033 was merged in windmill-ee-private. Previous ee-repo-ref: 8317dbf5116aaca61acfe2f20e4c2340b3f17377 New ee-repo-ref: 4a19159ab6f634de29673aa530b76d9a9710ab78 Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com> Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
11 KiB
Workspace roles
What a non-admin member may author, manage and see is its role. developer and operator are
the default roles; a licensed EE instance defines its own list in the workspace_roles global
setting (at least one role), and any workspace may override a role's capabilities in
workspace_settings.role_overrides, or, when licensed, add roles of its own there. A lapsed
license freezes them rather than dropping them (custom_roles_enabled): the stored list and the
workspace-only roles keep applying, writes that change them are refused, and resetting the list to
the defaults or removing a workspace-only role stays open. Falling back to the defaults instead
would hand a restricted developer everything. Workspace admin is not a
role: it is the is_admin flag on top of whichever role a member holds, and holds everything. The
code is windmill_common::roles.
Capabilities
| Capability | Values | Enforced |
|---|---|---|
code |
bool | yes: scripts, previews, dependency jobs, dynamic selects, resolving jobs, data table migrations, eval datasets |
flows |
none / compose / full |
yes; also AI agents, whose tools are checked as composed steps |
apps |
none / compose / full |
yes; low-code apps and worker-built apps need full |
manage_schedules, manage_triggers |
bool | yes, see docs/operator-write-rights.md |
run |
bool | yes, see Runs |
fork |
bool | yes, at both fork routes; unset by every layer, it is granted exactly to an unrestricted role |
visibility.* |
bool per page | no, UI only |
compose is the former operator builder right: the composition-only checks of
docs/operator-builder-rights.md run for it and are skipped only at full. full flows or apps
without code is refused at write, since both carry inline code.
Stored values are patches: an unset key falls through to the layer below, so a key added later
reads as "never configured". The layers, top first: the workspace override, the instance
definition, then RoleCapabilities::base_for (FULL for developer, the legacy operator for any
other name). A role name no longer defined resolves to NONE, so deleting a role fails closed;
deleting one that a member, invite, auto-invite or instance group mapping still names is refused,
and so is deleting an instance role that a workspace still overrides (the override would fall onto
base_for instead of the definition it was written against).
Runs
run withdrawn makes a role view-only: its members see what folder and item rights grant,
runs, logs and results included, and start nothing. gate_role_runs sits on the jobs router and
refuses every path under run/, run_wait_result/, run_and_stream/, run_inline/, restart/
and add_batch_jobs/ (GET included, which starts runs there), so a run route added under those
prefixes is gated for free. It lets through the dependency-lock and dynamic-select routes, which
code gates, and run/workflow_as_code, a step of a run already started. The three script
preview routes (run/preview, run_inline/preview, run_wait_result/preview) check run in
their handlers instead, after the exemption that lets a running job's SDK send a data table query
there, since jobs a view-only member owns still run as them. Callers that push
without the router check check_role_can_run themselves: the MCP per-runnable tools (which
tools/list also omits for such a role, along with the run endpoint tools), eval
experiment runs and members-only Slack agent shares (which run as the asking member). An MCP session token and the in-app AI session hold such a member to read-only, so neither offers a run tool. Resuming or approving a suspended step is not a run. Schedules and triggers keep
their own rights, apps run their runnables on the app's policy and are not gated, and a job
started by a schedule or trigger acts as its owner, so from inside it a view-only owner cannot
start further runs through the API either.
Unlike fork, withdrawing run makes a role restricted: it is an enforced gate on hot routes,
and the fast path is what spares every unrestricted caller a role lookup on each run. It does not
change seats: a role is a full seat by what it authors, not by whether it runs.
MCP access
A role may carry an MCP setting beside its capabilities (McpRoleSetting, EE): follow_role,
read_run, read_only, runnables (listed scripts and flows as tools, nothing else) or off.
runnables is refused on an instance role, since the paths are a workspace's. The setting
is a maximum for every MCP connection of the role's members, whatever the token and whenever it was
made, and never widens one; the in-app chat does not read it. Layers fall through as capabilities
do, so follow_role is stored by a workspace lifting the instance's limit. It is not a capability:
it must not restrict a role, cost a seat or reach an authoring gate.
- Workspace admins are held to the setting of the role they carry, as
DisableDirectDeploymentholds them. A superadmin who is no member carries no role. caller_mcp_limitreads the member's role only where some role carries a limit. An error or a role no longer defined refuses, unlikecan_run, which fails open.- A connection to one workspace is served by the role, not the URL (
served_under_limit):runnablesgets the tools server whatever the token, and anmcp:alltoken under another limit the session toolset, since endpoint tools are never served under one. Where a connection covers several workspaces the list is one for all, so the limit refuses at call time. - The connect page and the MCP tab of the home page read
workspace_access, the same computation aslist_workspaces, so a user is shown what they get rather than what they ask for. - A selection intersects with the token's own (
McpScopeConfig::limited_by). - A lapsed license freezes it as it does roles: it keeps applying and can be removed, not changed. On Community it is ignored and refused at write.
Forks
A member's role carries into a fork: the forker, and every member copy_members or
add_admins_and_developers_to_forks brings, joins the fork with the role they hold in the parent,
and the fork gets the parent's role_overrides so the name means the same there. A protection
ruleset's fork_role_mapping ({ role here: role in the fork }) replaces that role; where several
rulesets map one role, the first by name wins. A role named by a mapping cannot be deleted. A
fork's non-admin creator may add a parent member only when the mapping makes them a developer, so
re-adding cannot undo a mapping that restricts.
fork, like visibility, does not make a role restricted: withdrawing it from developer must not
turn every developer into an operator for the raw is_operator checks. So the fork routes read it
from the member's role (caller_can_fork), never through caller_capabilities' fast path.
Who is restricted
ApiAuthed::is_operator means "this member's role is restricted", computed at authentication from
the role, never from usr.operator alone. Every gate fast-paths on it (caller_capabilities
returns FULL for an unrestricted or admin caller without reading the role), so it must stay
derived from the role: a stale flag lets a restricted member through. The authentication cache
holds it for up to 120s.
ApiAuthed::capabilities is the role itself, read for each request before its handler runs, so a
capability check inside a save's transaction, the Hub rule included, never needs a second
connection. It is read from the role caches and never stored with the cached login: storing it
there would need every role change to clear the login on every server, running jobs' tokens
included. An identity built outside a request has none, and caller_capabilities reads the role.
usr.operator is kept as "this role cannot write code", which is what clients that predate roles
read it as. A member's role is usr.workspace_role, or, while that is NULL, operator /
developer from usr.operator: rows written by paths that know nothing of roles stay meaningful.
The old usr.role column is unrelated and holds legacy display strings.
Seats
A role that writes or composes anything costs a full seat; anything else half. Billing SQL cannot
merge capability patches, so role_seat materializes the author flag per role
(workspace_id = '' for the instance, a row per workspace override), rewritten by
sync_role_seats after every write to either setting. Every count reads it through
AUTHOR_SEAT_SQL, and usage telemetry reports builders (authors anywhere) against non-builders the
same way. A change that adds seats under an offline license is priced inside the transaction that
writes it, by check_seat_cap_for_role_change.
Legacy operator_settings
/operator_settings still works: it is applied as an override of the operator role, dropping any
key equal to what the instance gives that role, and the payload is mirrored into the
operator_settings column for git sync and older servers. The migration moved every key a
workspace had changed from its default into role_overrides.operator the same way. The workspace
list still returns an operator_settings object for a restricted member, synthesized from its
role, alongside role and capabilities.
In the settings document
role_overrides in the settings document (export settings.json, settings.yaml, git sync) is
the stored map, except that the entry of a role the instance does not define carries
workspace_only: true. The stored map cannot tell an override of instance role X from adding role
X, and the target of a promotion may lack X. So the apply refuses the whole document, dry run
included, before writing anything, if:
- an unmarked entry names a role the target instance does not define, unless the target workspace already has it as a workspace-only role (a file pulled before the marker existed), or
- a marked entry names a role the target instance defines.
The marker is never stored. Roles are written before every other setting, so an instance group mapping in the same file can name a role it adds. A workspace-only role the file removes is kept until a final write, after whatever named it has been rewritten, so the in-use check passes.
The document's operator_settings is derived from the effective operator role, not read from
the column: only the legacy endpoint rewrites the column, so after a role edit it holds stale
flags. A document that states role_overrides never applies operator_settings, and warns when
it was edited to disagree with the operator role. A document without role_overrides (pulled
before roles existed) applies it as before, diffed against the column.