[GH-ISSUE #2743] Dynamic Roles and Permissions #9328

Closed
opened 2026-04-13 04:45:48 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @gerkim62 on GitHub (May 22, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2743

Is this suited for github?

  • Yes, this is suited for github

Currently, better-auth only supports hardcoded roles in the codebase, which makes it impossible to manage access control dynamically without deploying code changes or when the permissions and roles are not already known beforehand.

Describe the solution you'd like

I’d like better-auth to support dynamic roles and permissions that can be created and managed at runtime—ideally via an API or admin UI. These roles be stored in database.

Describe alternatives you've considered

Building a separate, custom access control layer on top of better-auth, but this duplicates effort and adds complexity.

Additional context

See this related discussion: https://www.answeroverflow.com/m/1357026607033880727

Originally created by @gerkim62 on GitHub (May 22, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2743 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Currently, better-auth only supports hardcoded roles in the codebase, which makes it impossible to manage access control dynamically without deploying code changes or when the permissions and roles are not already known beforehand. ### Describe the solution you'd like I’d like better-auth to support dynamic roles and permissions that can be created and managed at runtime—ideally via an API or admin UI. These roles be stored in database. ### Describe alternatives you've considered Building a separate, custom access control layer on top of better-auth, but this duplicates effort and adds complexity. ### Additional context See this related discussion: [https://www.answeroverflow.com/m/1357026607033880727](https://www.answeroverflow.com/m/1357026607033880727)
GiteaMirror added the enhancementlocked labels 2026-04-13 04:45:48 -05:00
Author
Owner

@yavuz1205 commented on GitHub (May 23, 2025):

I'm experiencing the exact same issue and would really appreciate this feature being implemented.

<!-- gh-comment-id:2905486468 --> @yavuz1205 commented on GitHub (May 23, 2025): I'm experiencing the exact same issue and would really appreciate this feature being implemented.
Author
Owner

@brettfullstack commented on GitHub (May 23, 2025):

I have the same problem and because of this problem I am thinking of changing the package no matter how good it is. I tried to update it with my own additions but I would be very happy if the package updates itself in this area.

<!-- gh-comment-id:2905489204 --> @brettfullstack commented on GitHub (May 23, 2025): I have the same problem and because of this problem I am thinking of changing the package no matter how good it is. I tried to update it with my own additions but I would be very happy if the package updates itself in this area.
Author
Owner

@Bruhun commented on GitHub (May 25, 2025):

Same issue, can't really go forward with it...

<!-- gh-comment-id:2907924357 --> @Bruhun commented on GitHub (May 25, 2025): Same issue, can't really go forward with it...
Author
Owner

@ohabash commented on GitHub (Jun 5, 2025):

We need this too.

When my app starts cant we just remove hard coded things and get the data from our own database instead? then when there is a change in those databases we would just restart the access controls?

Please let me know if you think this would work.

<!-- gh-comment-id:2946315146 --> @ohabash commented on GitHub (Jun 5, 2025): We need this too. When my app starts cant we just remove hard coded things and get the data from our own database instead? then when there is a change in those databases we would just restart the access controls? Please let me know if you think this would work.
Author
Owner

@sovetski commented on GitHub (Jun 24, 2025):

It seems like a good idea, but with dynamic roles, wouldn’t we lose the benefits of TypeScript?

<!-- gh-comment-id:3001283934 --> @sovetski commented on GitHub (Jun 24, 2025): It seems like a good idea, but with dynamic roles, wouldn’t we lose the benefits of TypeScript?
Author
Owner

@ohabash commented on GitHub (Jun 24, 2025):

there is no type safety in any RBAC system where there is dynamic control. Unless the values are predefined. Or unless they are generated or handled manually. Kind of like prisma generate

<!-- gh-comment-id:3001940662 --> @ohabash commented on GitHub (Jun 24, 2025): there is no type safety in any RBAC system where there is dynamic control. Unless the values are predefined. Or unless they are generated or handled manually. Kind of like prisma generate
Author
Owner

@gerkim62 commented on GitHub (Jun 26, 2025):

This is a reasonable compromise

<!-- gh-comment-id:3007602353 --> @gerkim62 commented on GitHub (Jun 26, 2025): This is a reasonable compromise
Author
Owner

@thereis commented on GitHub (Aug 13, 2025):

Looking forward for this feature!

<!-- gh-comment-id:3182680201 --> @thereis commented on GitHub (Aug 13, 2025): Looking forward for this feature!
Author
Owner

@its4lion commented on GitHub (Aug 27, 2025):

Would be awesome to add this to the admin plugin too!

<!-- gh-comment-id:3229578857 --> @its4lion commented on GitHub (Aug 27, 2025): Would be awesome to add this to the admin plugin too!
Author
Owner

@yavuz1205 commented on GitHub (Sep 9, 2025):

@gerkim62 @Bekacru Since this feature was added in version 1.3.8, we can close this issue.

<!-- gh-comment-id:3271970138 --> @yavuz1205 commented on GitHub (Sep 9, 2025): @gerkim62 @Bekacru Since this feature was added in version 1.3.8, we can close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9328