fix(roles): reflect & preserve wildcard tool grants in the role editor - #6157
Open
AriOliv wants to merge 1 commit into
Open
fix(roles): reflect & preserve wildcard tool grants in the role editor#6157AriOliv wants to merge 1 commit into
AriOliv wants to merge 1 commit into
Conversation
The org role editor rendered a connection's tools as unchecked even when the role already granted them, and re-saving destroyed the grant: convertRoleToFormData expanded a stored ["*"] (all-tools) grant via conn.tools, but COLLECTION_CONNECTIONS_LIST omits tools (fetched lazily per selected connection) -> the grant expanded to [] -> every tool showed unchecked and buildPermission dropped the entry on the next save. Grants for connections absent from the current (paginated) page were likewise dropped. Now the raw grant (including the "*" sentinel) is preserved, and ToolSetSelector understands "*" as all-tools for checked state, counts, and per-tool + per-connection toggles (toggling one tool off first expands "*" to concrete names). buildPermission already collapses a fully-selected connection back to ["*"], so grants round-trip. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AriOliv
force-pushed
the
fix/role-editor-tool-grants
branch
from
August 17, 2026 23:31
54ed0b6 to
8913537
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The organization role editor (Settings → Roles → MCP Permissions) renders a connection's tools as unchecked even when the role already grants them, and re-saving destroys the grant.
convertRoleToFormDataexpands a stored["*"](all-tools) grant into concrete names viaconn.tools:But the connection list endpoint (
COLLECTION_CONNECTIONS_LIST) omitstools— the editor fetches them lazily per selected connection. Soconn.toolsisundefined, the grant expands to[], and:0/N) even though the role grants them, and[]back →buildPermissiondrops the entry → the grant is destroyed.Grants for connections not present in the current (paginated) list were likewise dropped on load.
Fix
convertRoleToFormDatapreserves the raw grant, including the"*"sentinel, and no longer drops grants for connections missing from the current page.ToolSetSelectorunderstands"*"as "all tools" for checked state, theN/Ncount, and both per-tool and per-connection toggles (toggling a single tool off first expands"*"to concrete names so the rest stay selected).buildPermissionalready collapses a fully-selected connection back to["*"], so grants round-trip cleanly.Testing
tsc --noEmitonapps/webpasses.["*"]) now reopens fully checked instead of0/N, and survives a re-save instead of being wiped.🤖 Generated with Claude Code