[GH-ISSUE #4493] Support for assigning roles to teams #9956

Open
opened 2026-04-13 05:48:38 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @codylittle on GitHub (Sep 7, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4493

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

Assigning roles to individual users within an organisation can be tiresome when there is a large number of users and/or roles, especially with the introduction of organisation specific roles.

Being able to logically group users together for role assignments would relieve this.

Describe the solution you'd like

Being able to logically group users together for role assignments.

Describe alternatives you've considered

We previously had a group plugin for logically grouping users within an organisation. However, we deprecated this in favour of utilising the teams to benefit from native support.

Additional context

I believe that teams is the best way to support this as they're already the means of logically grouping multiple users within an organisation. Alternatively, if groups were added as an alternative, they could additionally be used to assign users to teams. They would also support the SCIM work in #3277 - otherwise have the groups SCIM endpoint map to creation of teams within an organisation.

Originally created by @codylittle on GitHub (Sep 7, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4493 Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Assigning roles to individual users within an organisation can be tiresome when there is a large number of users and/or roles, especially with the introduction of organisation specific roles. Being able to logically group users together for role assignments would relieve this. ### Describe the solution you'd like Being able to logically group users together for role assignments. ### Describe alternatives you've considered We previously had a `group` plugin for logically grouping users within an organisation. However, we deprecated this in favour of utilising the teams to benefit from native support. ### Additional context I believe that teams is the best way to support this as they're already the means of logically grouping multiple users within an organisation. Alternatively, if groups were added as an alternative, they could additionally be used to assign users to teams. They would also support the SCIM work in #3277 - otherwise have the groups SCIM endpoint map to creation of teams within an organisation.
GiteaMirror added the organization label 2026-04-13 05:48:38 -05:00
Author
Owner

@XavierGeerinck commented on GitHub (Nov 1, 2025):

FYI: Gave this a shot in #5718

<!-- gh-comment-id:3476348834 --> @XavierGeerinck commented on GitHub (Nov 1, 2025): FYI: Gave this a shot in #5718
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 1, 2025):

Based on your experiment in #5718, the recommended next steps are:

• Verify that your implementation correctly groups users into teams and that these groups are being used consistently for role assignments. This means confirming that team data is correctly passed into the access control logic so that team-specific roles operate as expected.

• Check that any SCIM mapping, as proposed, is aligned with the teams endpoint behavior. This will ensure that if groups are later mapped to teams, the endpoint works seamlessly with existing users.

• If you encounter unexpected behavior, review your logs and any discrepancies between what’s expected versus what occurs during team-based role assignments, then adjust accordingly.

This approach aligns with our preferred solution of leveraging native team functionality to logically group users for roles [1].

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3476349007 --> @better-auth-agent[bot] commented on GitHub (Nov 1, 2025): Based on your experiment in #5718, the recommended next steps are: • Verify that your implementation correctly groups users into teams and that these groups are being used consistently for role assignments. This means confirming that team data is correctly passed into the access control logic so that team-specific roles operate as expected. • Check that any SCIM mapping, as proposed, is aligned with the teams endpoint behavior. This will ensure that if groups are later mapped to teams, the endpoint works seamlessly with existing users. • If you encounter unexpected behavior, review your logs and any discrepancies between what’s expected versus what occurs during team-based role assignments, then adjust accordingly. This approach aligns with our preferred solution of leveraging native team functionality to logically group users for roles [[1]](https://github.com/better-auth/better-auth/issues/4493). <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@CarlosCommits commented on GitHub (Dec 28, 2025):

+1
This would be helpful.

<!-- gh-comment-id:3694982868 --> @CarlosCommits commented on GitHub (Dec 28, 2025): +1 This would be helpful.
Author
Owner

@at0mweb commented on GitHub (Mar 23, 2026):

+1

<!-- gh-comment-id:4107270485 --> @at0mweb commented on GitHub (Mar 23, 2026): +1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9956