Skip to content

Offer Remove on an owner's row only to an owner - #2076

Merged
davidmckayv merged 1 commit into
mainfrom
fix/members-remove-owner-guard
Nov 23, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
fix/members-remove-owner-guard

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

The server refuses when an admin who isn't an owner removes an organization owner: only an owner may remove another owner. The Members list in Organization settings still offered such an admin Remove on a co-owner's row, and the click got a refusal.

What changed

  • memberControl now also checks the viewer. On an owner's row, an owner is offered Remove and an admin is offered nothing. Leave on your own row is unchanged.
  • removable stays as it is. It says whether a membership can end at all (it also drives Leave), not who may end it, so the viewer's role is the right signal here.

Tests

  • New real-browser test, app/tests/organization-members-remove.test.tsx, in Chromium and WebKit, at 1440 and 390, light and dark: for an organization with two owners, an admin sees Remove only on a member's row, and an owner sees it on both owners too. Fails before the fix (8 of 8 admin cases), passes after (16 of 16). Added to the WebKit job.
  • The unit case for memberControl covers a removable co-owner seen by an owner, an admin, and themselves.

Screenshots compared before and after: the owner rows lose their Remove for an admin and nothing else on the page moves. The owner's view is unchanged.

The server now refuses when an admin who isn't an owner removes an owner.
The Members list still offered such an admin Remove on a co-owner's row,
and the click got a refusal. `removable` says whether a membership can end
at all, not who may end it, so the row now also checks the viewer: an owner
is offered Remove on another owner, an admin is offered nothing there.
Leave on your own row is unchanged.

A real-browser test in Chromium and WebKit draws the Members list for an
organization with two owners, as an admin and as an owner, wide and on a
phone, light and dark. It runs in the WebKit job.
@davidmckayv
davidmckayv merged commit 9e07c56 into main Nov 23, 2026
34 checks passed
@davidmckayv
davidmckayv deleted the fix/members-remove-owner-guard branch November 23, 2026 20:12
davidmckayv added a commit that referenced this pull request Nov 23, 2026
Offer Remove on an owner's row only to an owner

The server now refuses when an admin who isn't an owner removes an owner.
The Members list still offered such an admin Remove on a co-owner's row,
and the click got a refusal. `removable` says whether a membership can end
at all, not who may end it, so the row now also checks the viewer: an owner
is offered Remove on another owner, an admin is offered nothing there.
Leave on your own row is unchanged.

A real-browser test in Chromium and WebKit draws the Members list for an
organization with two owners, as an admin and as an owner, wide and on a
phone, light and dark. It runs in the WebKit job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant