[PR #2229] [CLOSED] feat: add customRole support to access and organization plugins #4214

Closed
opened 2026-03-13 11:37:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2229
Author: @productdevbook
Created: 4/12/2025
Status: Closed

Base: mainHead: feat/customRole


📝 Commits (3)

  • 27ee4f0 feat: add customRole support to access and organization plugins
  • 77ad8f4 fix: enforce customRole as a required parameter in authorize method
  • ca17e07 fix: update customRole references to use correct property from data object

📊 Changes

13 files changed (+37 additions, -5 deletions)

View changed files

📝 packages/better-auth/src/plugins/access/access.ts (+1 -0)
📝 packages/better-auth/src/plugins/access/types.ts (+1 -1)
📝 packages/better-auth/src/plugins/admin/admin.ts (+14 -2)
📝 packages/better-auth/src/plugins/admin/client.ts (+2 -0)
📝 packages/better-auth/src/plugins/admin/has-permission.ts (+2 -1)
📝 packages/better-auth/src/plugins/organization/client.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/has-permission.ts (+2 -1)
📝 packages/better-auth/src/plugins/organization/organization.ts (+1 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-invites.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-team.ts (+3 -0)
📝 packages/better-auth/src/plugins/organization/schema.ts (+3 -0)

📄 Description

I'm trying to come up with a custom role structure. I think this will work. With the existing better auth role we need to check within our own role structure authorize.

This structure did not work properly. Please help me !


🔄 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/2229 **Author:** [@productdevbook](https://github.com/productdevbook) **Created:** 4/12/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/customRole` --- ### 📝 Commits (3) - [`27ee4f0`](https://github.com/better-auth/better-auth/commit/27ee4f0f3b44ebb262f7146139bf75289216717c) feat: add customRole support to access and organization plugins - [`77ad8f4`](https://github.com/better-auth/better-auth/commit/77ad8f451a89cc91033647e85c2eed262ebe9b01) fix: enforce customRole as a required parameter in authorize method - [`ca17e07`](https://github.com/better-auth/better-auth/commit/ca17e072a244105a0fdedb99c68aa71ca78bd7b1) fix: update customRole references to use correct property from data object ### 📊 Changes **13 files changed** (+37 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/access/access.ts` (+1 -0) 📝 `packages/better-auth/src/plugins/access/types.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+14 -2) 📝 `packages/better-auth/src/plugins/admin/client.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/admin/has-permission.ts` (+2 -1) 📝 `packages/better-auth/src/plugins/organization/client.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/has-permission.ts` (+2 -1) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+1 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-invites.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-team.ts` (+3 -0) 📝 `packages/better-auth/src/plugins/organization/schema.ts` (+3 -0) </details> ### 📄 Description I'm trying to come up with a custom role structure. I think this will work. With the existing better auth role we need to check within our own role structure authorize. This structure did not work properly. Please help me ! --- <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-03-13 11:37:50 -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#4214