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

Skip to content

fix: gate group settings page and fix unauthorized group patch - #28314

Merged
ssncferreira merged 1 commit into
mainfrom
susana/aigov-603-hide-group-budget-controls-without-permission
Aug 20, 2026
Merged

fix: gate group settings page and fix unauthorized group patch#28314
ssncferreira merged 1 commit into
mainfrom
susana/aigov-603-hide-group-budget-controls-without-permission

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Problem

A user without group:update (e.g. the Coder Agents User role) could open the group settings page by direct URL and edit the budget. Saving then failed with a misleading error:

Failed to add or remove non-existent group member — execute transaction: update group by ID: unauthorized: rbac: forbidden.

The authorization failure was misclassified as a missing group member, and the settings page was not gated on the required permission.

Changes

  • Return the standard vague 404 for authorization failures in the group PATCH handler, so the response is accurate and does not leak resource existence.
  • Use a generic message for the remaining 400 branch, since it covers various transaction failures rather than only member add/remove.
  • Gate the group settings page on group:update. The settings tab is already hidden without the permission, but the page was reachable by direct URL and rendered an editable form that always failed on save. It now shows the standard permission dialog.

Fixes AIGOV-603.

Note

Generated by Coder Agents, reviewed by @ssncferreira.

@linear-code

linear-code Bot commented Aug 19, 2026

Copy link
Copy Markdown

AIGOV-603

@ssncferreira
ssncferreira force-pushed the susana/aigov-603-hide-group-budget-controls-without-permission branch 2 times, most recently from 7587ea9 to 653c03c Compare August 20, 2026 12:15
Updating a group (e.g. its budget) as a user without group:update
returned a 400 "Failed to add or remove non-existent group member"
because the authorization failure was misclassified. Return the standard
vague 404 for unauthorized errors so the response is accurate and does
not leak resource existence, and use a generic message for the remaining
400 branch since it covers various transaction failures.

Also gate the group settings page on group:update. The settings tab is
already hidden without the permission, but the page was reachable by
direct URL and rendered an editable form that always failed on save. It
now shows the standard permission dialog.
@ssncferreira
ssncferreira force-pushed the susana/aigov-603-hide-group-budget-controls-without-permission branch from 653c03c to 420ba02 Compare August 20, 2026 12:23
@ssncferreira ssncferreira changed the title fix: hide group budget controls and fix unauthorized group patch fix: gate group settings page and fix unauthorized group patch Aug 20, 2026
@ssncferreira
ssncferreira marked this pull request as ready for review August 20, 2026 12:25
@ssncferreira
ssncferreira requested review from EhabY and johnstcn August 20, 2026 12:25

@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.

Makes sense, glad it's fixed now!

@ssncferreira
ssncferreira merged commit ab66010 into main Aug 20, 2026
37 checks passed
@ssncferreira
ssncferreira deleted the susana/aigov-603-hide-group-budget-controls-without-permission branch August 20, 2026 13:51
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants