Skip to content

chore: allow removing users from the default org #14699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: allow removing users from the default org
Removed as no longer in experimental
  • Loading branch information
Emyrk committed Sep 17, 2024
commit b39029f47892e358e22d39eb616897236486a10d
13 changes: 0 additions & 13 deletions coderd/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,6 @@ func (api *API) deleteOrganizationMember(rw http.ResponseWriter, r *http.Request
aReq.Old = member.OrganizationMember.Auditable(member.Username)
defer commitAudit()

if organization.IsDefault {
// Multi-organizations is currently an experiment, which means it is feasible
// for a deployment to enable, then disable this. To maintain backwards
// compatibility, this safety is necessary.
// TODO: Remove this check when multi-organizations is fully supported.
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Removing members from the default organization is not supported.",
Detail: "Multi-organizations is currently an experiment, and until it is fully supported, the default org should be protected.",
Validations: nil,
})
return
}

if member.UserID == apiKey.UserID {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{Message: "cannot remove self from an organization"})
return
Expand Down