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

Open
opened 2026-04-13 09:29:08 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5768

State: open
Merged: No


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.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5768 **State:** open **Merged:** No --- 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. -->
GiteaMirror added the pull-request label 2026-04-13 09:29:08 -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#14460