Team Roles
Stack Auth uses a permission-based system for team access control. While there are no predefined “roles” in the traditional sense, the platform provides default permission sets for different member types.Member Types
When users are added to teams, they are assigned one of two types:1. Creator
The user who creates a team is automatically assigned as the creator. Creators receive theteamCreator default permissions.
apps/backend/src/app/api/latest/teams/crud.tsx:88:
2. Member
Users who join a team (via invitation or direct addition) are assigned as members. Members receive theteamMember default permissions.
apps/backend/src/app/api/latest/team-memberships/crud.tsx:80:
Default Permissions
Default permissions are automatically granted when users join teams. These are configured in your project’s RBAC settings. Fromapps/backend/src/lib/permissions.tsx:514:
Configuration
You can configure default permissions in your project settings:Custom Roles via Permission Groups
While Stack Auth doesn’t have built-in “roles,” you can implement role-like behavior using permission groups:Checking Member Type
You can determine if a user is the creator by checking their permissions:Team Member Schema
Per-Team User Profiles
Team members can have different display names and profile images per team:Selected Team
Users can have one “selected” team at a time, useful for UI state:Best Practices
- Use Permission Groups: Instead of managing individual permissions, create permission groups that represent roles
- Document Your Roles: Maintain documentation of what each custom “role” (permission group) represents
- Audit Permissions: Regularly review which permissions are granted to which member types
- Principle of Least Privilege: Only grant the minimum permissions needed for each role
Migration from Role-Based Systems
If you’re migrating from a traditional role-based system:- Team Permissions - Detailed permission system documentation
- Team Overview - General team concepts