Hierarchically nested teams

Goal: Get organization with proper hierarchical structure. There is top level team that has more teams (departments) bellow, bellow that departments there is even more teams. Is something like that possible with Nest.js via adding custom field?
2 Replies
arnez
arnezOP2w ago
@Better AuthTitle: Hierarchically nested teams Goal: Get organization with proper hierarchical structure. There is top level team that has more teams (departments) bellow, bellow that departments there is even more teams. Is something like that possible with Nest.js via adding custom field?
Better Auth
Better Auth2w ago
Currently, Better Auth’s teams feature is designed with a flat structure at the organization level rather than a nested, hierarchical model. You can add custom fields (for example, a parentTeamId) to store relationships between teams, but the core permission logic and endpoints aren’t built to automatically support multi-level hierarchies [1][4]. If you need a deeply nested structure (e.g., a top-level team with departments and sub-departments), you can simulate it by extending the team model with your custom field and then implementing your own logic in your Nest.js application to enforce and manage those relationships. Just be aware that this custom approach won’t automatically integrate with Better Auth’s built-in permission checks or API endpoints—you’ll need to handle those details manually. I hope this helps clarify your options! Sources: [1] Feature: Teams for Organizations [4] Organization | Better Auth
GitHub
Feature: Teams for Organizations · Issue #496 · better-auth/bette...
Is your feature request related to a problem? Please describe. Organization with tens or hundreds of members will need to become more structured. It's very unlikely that all members need to be ...
Organization | Better Auth
The organization plugin allows you to manage your organization's members and teams.

Did you find this page helpful?