Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: hide AI budget override controls without permission - #27654

Merged
ssncferreira merged 5 commits into
mainfrom
ssncf/readonly-user-override
Jul 30, 2026
Merged

fix: hide AI budget override controls without permission#27654
ssncferreira merged 5 commits into
mainfrom
ssncf/readonly-user-override

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

Setting a user's AI budget override updates both the user and the group its spend is charged to, so it requires user:update and group:update. Organization admins have group update but only site-wide user read, so they could tick "Override group budget", enter an amount, and then fail on save.

The dialog now shows the member's budget as read-only when the viewer can't change it.

Changes

  • Gate the override controls on user:update (site-wide) in addition to the group permission the page already checks
  • Replace the form with a read-only view: the group's budget, followed by "To update this limit, contact a Coder administrator."
  • Swap the whole view rather than disabling the checkbox, since an existing override seeds the form enabled and unchecking it would call the delete endpoint and fail the same way
  • Add stories for the read-only dialog and for the page-level wiring

Note

Initially generated by Claude Opus 5, modified and reviewed by @ssncferreira

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ssncferreira
ssncferreira force-pushed the ssncf/readonly-user-override branch from 13ca608 to 7f6ee15 Compare July 29, 2026 18:19
@ssncferreira
ssncferreira marked this pull request as ready for review July 29, 2026 18:19
@ssncferreira
ssncferreira requested a review from EhabY July 29, 2026 18:19
Comment thread site/src/pages/GroupsPage/UserAIBudgetOverrideDialog.tsx Outdated
Comment thread site/src/pages/GroupsPage/UserAIBudgetOverrideDialog.tsx Outdated
Comment thread site/src/pages/GroupsPage/UserAIBudgetOverrideDialog.tsx Outdated
Comment thread site/src/pages/GroupsPage/GroupMembersPage.tsx
Comment thread site/src/pages/GroupsPage/UserAIBudgetOverrideDialog.tsx Outdated
Comment thread site/src/pages/GroupsPage/UserAIBudgetOverrideDialog.stories.tsx Outdated
@ssncferreira
ssncferreira force-pushed the ssncf/readonly-user-override branch from 7f6ee15 to 3918ea4 Compare July 30, 2026 09:23
@ssncferreira
ssncferreira force-pushed the ssncf/readonly-user-override branch from 3918ea4 to 63e9058 Compare July 30, 2026 11:18
@ssncferreira
ssncferreira requested a review from EhabY July 30, 2026 12:30

@EhabY EhabY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it 🚀

@ssncferreira
ssncferreira merged commit b4eda32 into main Jul 30, 2026
27 checks passed
@ssncferreira
ssncferreira deleted the ssncf/readonly-user-override branch July 30, 2026 13:28
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants