{{ message }}
fix(coderd): let admins change their own workspace sharing role#26559
Merged
Conversation
Workspace ACL updates blocked any user from changing their own sharing role. Org and deployment admins hold workspace share permission across the organization independent of a workspace's ACL, so they may now manage their own access. Users whose only access is the share itself remain blocked from destructively demoting themselves.
geokat
approved these changes
Jun 22, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Org and deployment admins couldn't share a workspace with themselves. Workspace ACL updates rejected any change to the caller's own sharing role, even for admins whose share permission comes from their role rather than the workspace.
Self-edits are now allowed when the caller can share any workspace in the organization. Users whose only access is the share itself remain blocked from destructively demoting themselves.
Design notes
The self-guard is skipped only when
Authorize(share, ResourceWorkspace.InOrg(org))passes. That abstract, owner-less check is satisfied by org/site-level role grants, but not by owner-scoped member permissions or by a specific workspace's ACL, so it distinguishes role-based share from share that derives from the workspace itself. The dbauthz layer still independently authorizesshareon the workspace.This PR was created by Coder Agents on behalf of @aslilac.