Repository navigation
feat: make SQL writes a permission (EXECUTE_WRITES) so custom roles can write - #131
Merged
Merged
Conversation
…an write Writes were gated on the built-in ADMIN or DBA role name, in the backend (AccessControlService.currentUserMayMutateSql) and the frontend (useAuth). A custom role could therefore never write, which also made EXECUTE_DDL impossible to hand to a subset of DBAs: a 'DBA + schema changes' role lost UPDATE/INSERT/DELETE entirely. EXECUTE_WRITES defaults to ADMIN and DBA, so nobody's access changes. Every authentication path (JWT, MCP token, View-as) carries effective permissions as authorities, loaded per request, so the check takes effect without re-login. The Editor's 'DBA mode' label becomes 'Write mode' since custom roles can now see it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
geekypunk
requested review from
a team and
venkateshsakamuri-lab
as code owners
November 7, 2026 19:05
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.
Why
Writes were gated on the built-in ADMIN or DBA role name, in both
AccessControlService.currentUserMayMutateSqland the frontend'suseAuth. A custom role could never write. That made it impossible to giveEXECUTE_DDL(added in #130) to only some DBAs: a custom "DBA + schema changes" role would lose UPDATE/INSERT/DELETE entirely.What changes
EXECUTE_WRITESpermission, held by ADMIN and DBA by default, so no one's access changes on deploy.EXECUTE_WRITESis revoked by an override can no longer write; a custom role granted it can.Test plan
AccessControlServiceTestuses production-shaped authorities (ROLE_*plus permission names), with new cases for a custom role granted writes and a role name alone granting nothingEXECUTE_WRITESandEXECUTE_DDL, and assign it to the DBAs who need schema changes🤖 Generated with Claude Code