feat(server): refuse local edits to hq-sourced users
The API is the boundary; hiding the control in web/ is a courtesy. A role editable in two places is a role with two answers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -111,7 +111,9 @@ func deleteInstanceUser(c *gin.Context) {
|
||||
}
|
||||
|
||||
func orgUserErrStatus(err error) int {
|
||||
if errors.Is(err, services.ErrLastOwner) {
|
||||
// 409 rather than 403: the caller has the right to manage members, and the
|
||||
// request is refused because of the resource's state, not their permissions.
|
||||
if errors.Is(err, services.ErrLastOwner) || errors.Is(err, services.ErrHQManaged) {
|
||||
return http.StatusConflict
|
||||
}
|
||||
return http.StatusInternalServerError
|
||||
|
||||
Reference in New Issue
Block a user