Skip to content

fix(api,user-ui): protect organization administrator role#155

Merged
markwylde merged 2 commits into
mainfrom
codex/fix-organization-admin-role-guard
Jun 2, 2026
Merged

fix(api,user-ui): protect organization administrator role#155
markwylde merged 2 commits into
mainfrom
codex/fix-organization-admin-role-guard

Conversation

@markwylde
Copy link
Copy Markdown
Member

@markwylde markwylde commented Jun 2, 2026

Summary

  • Enforce organization administrator invariants in the API when removing a member role.
  • Add a permission-based check so removing a role that grants darkauth.org:manage cannot leave an organization without any administrator.
  • Extend organization role/member payloads with grantsOrgManage metadata for UI enforcement.
  • Update the organization detail UI to prevent unsafe removals (role removal and member removal states), and wire role-add/remove state handling consistently.
  • Add API test coverage to validate the last administrator role cannot be removed.

@markwylde markwylde merged commit 0794b14 into main Jun 2, 2026
18 checks passed
@markwylde markwylde deleted the codex/fix-organization-admin-role-guard branch June 2, 2026 21:00
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