[PR #5768] feat(organization): admin can manage organization #23114

Open
opened 2026-04-15 21:29:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5768
Author: @okisdev
Created: 11/5/2025
Status: 🔄 Open

Base: nextHead: feat(organization)/admin-can-manage-organization


📝 Commits (10+)

  • 976265a feat(organization): admin can manage organization
  • 135131a feat(organization): admin can manage organization
  • 7158738 feat(organization): admin can manage organization
  • 5c0ad07 feat(organization): admin can manage organization
  • 498875c Merge branch 'canary' into feat(organization)/admin-can-manage-organization
  • 430d421 feat(organization): admin can manage organization
  • dc8b86a Merge branch 'canary' into feat(organization)/admin-can-manage-organization
  • 5467f8a Merge branch 'canary' into feat(organization)/admin-can-manage-organization
  • 0f81a58 Merge branch 'canary' into feat(organization)/admin-can-manage-organization
  • cdc9280 feat(organization): admin can manage organization

📊 Changes

4 files changed (+468 additions, -61 deletions)

View changed files

📝 docs/content/docs/plugins/organization.mdx (+8 -0)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+332 -11)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+109 -48)
📝 packages/better-auth/src/plugins/organization/types.ts (+19 -2)

📄 Description

This PR adds actions to allow admin to manage organization without being a member in that organization.

This PR fixes #1595


Summary by cubic

Adds a new globalOrganizationAccess option to the Organization plugin, allowing admins (or configured roles/custom logic) to update and delete any organization without being a member. This streamlines org management for platform admins.

  • New Features

    • Introduced OrganizationOptions.globalOrganizationAccess (boolean | string[] | function) with default false.
    • When enabled: admins (or specified roles) can update/delete orgs without membership; a function can grant access per request.
    • Update/delete routes now check global access before membership/permissions; hooks accept member as null when global access applies.
    • Requires the Admin plugin for role-based access (boolean/role array).
    • Added docs and tests for boolean, role array, and function scenarios.
  • Bug Fixes

    • Fetching an org after deletion now returns ORGANIZATION_NOT_FOUND (400).

Written for commit 4b93b66b84. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5768 **Author:** [@okisdev](https://github.com/okisdev) **Created:** 11/5/2025 **Status:** 🔄 Open **Base:** `next` ← **Head:** `feat(organization)/admin-can-manage-organization` --- ### 📝 Commits (10+) - [`976265a`](https://github.com/better-auth/better-auth/commit/976265a42525f13cc4aedaa78443a845b7619510) feat(organization): admin can manage organization - [`135131a`](https://github.com/better-auth/better-auth/commit/135131a9e8a478ee6c5c65d61c69b7d06ca0e85f) feat(organization): admin can manage organization - [`7158738`](https://github.com/better-auth/better-auth/commit/7158738622e677930d27435af8b6d49092d87c81) feat(organization): admin can manage organization - [`5c0ad07`](https://github.com/better-auth/better-auth/commit/5c0ad0797b7f5d85ae7650b18e8c0c5e8eb6fc25) feat(organization): admin can manage organization - [`498875c`](https://github.com/better-auth/better-auth/commit/498875c274be00b08ae5ce9f7652f0381e6c3d63) Merge branch 'canary' into feat(organization)/admin-can-manage-organization - [`430d421`](https://github.com/better-auth/better-auth/commit/430d4216c9c1b0d86f45aff76ec7460e99100566) feat(organization): admin can manage organization - [`dc8b86a`](https://github.com/better-auth/better-auth/commit/dc8b86a02c647fc1c1c0a8073d3f4a49ed8a607b) Merge branch 'canary' into feat(organization)/admin-can-manage-organization - [`5467f8a`](https://github.com/better-auth/better-auth/commit/5467f8a613a9b5e1b37c557be713cfe99348f693) Merge branch 'canary' into feat(organization)/admin-can-manage-organization - [`0f81a58`](https://github.com/better-auth/better-auth/commit/0f81a589437d60fbb5db813f4b3a84831091349b) Merge branch 'canary' into feat(organization)/admin-can-manage-organization - [`cdc9280`](https://github.com/better-auth/better-auth/commit/cdc92803fd926e35f202867ac1106694a9e637ba) feat(organization): admin can manage organization ### 📊 Changes **4 files changed** (+468 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/organization.mdx` (+8 -0) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+332 -11) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+109 -48) 📝 `packages/better-auth/src/plugins/organization/types.ts` (+19 -2) </details> ### 📄 Description This PR adds actions to allow admin to manage organization without being a member in that organization. This PR fixes #1595 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a new globalOrganizationAccess option to the Organization plugin, allowing admins (or configured roles/custom logic) to update and delete any organization without being a member. This streamlines org management for platform admins. - **New Features** - Introduced OrganizationOptions.globalOrganizationAccess (boolean | string[] | function) with default false. - When enabled: admins (or specified roles) can update/delete orgs without membership; a function can grant access per request. - Update/delete routes now check global access before membership/permissions; hooks accept member as null when global access applies. - Requires the Admin plugin for role-based access (boolean/role array). - Added docs and tests for boolean, role array, and function scenarios. - **Bug Fixes** - Fetching an org after deletion now returns ORGANIZATION_NOT_FOUND (400). <sup>Written for commit 4b93b66b8427e11c11a977a4589f849b284a2727. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 21:29:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#23114