What is a Role?
A role is a named collection of permissions. Instead of assigning individual permissions to each subject, you create roles like “Editor” or “Admin” and assign those roles to subjects via their memberships.Role Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Human-readable name (e.g., “Editor”, “Admin”) |
description | string? | What this role is for |
scopeId | string | The scope where this role is defined |
Creating Roles
Roles are defined at a specific scope and can be used in that scope and all its descendants:Role Permissions
A role is just a container—it has no permissions until you add them. Use role permissions to connect roles to permissions:Role Assignments
To grant a role to a subject, create a role assignment that links the role to a membership:Role Inheritance
Roles defined at a parent scope are available in all child scopes:Scope-Specific Roles
You can also define roles at child scopes for more specific use cases:Common Role Patterns
Standard RBAC Roles
Agent-Specific Roles
Functional Roles
Role Overrides
You can disable a role at a child scope using role overrides:Learn about Overrides
See all override types and patterns
Multiple Roles per Membership
A membership can have multiple roles:Viewing Role Permissions
Viewing Role Assignments
Best Practices
Keep roles focused
Keep roles focused
Create roles for specific purposes rather than catch-all roles. “Billing Manager” is better than “Manager”.
Define roles at the right level
Define roles at the right level
Organization-wide roles at the org level, team-specific roles at the team level.
Use descriptive names
Use descriptive names
“Document Editor” is clearer than “Editor” if you have multiple resource types.
Document role purposes
Document role purposes
Use the
description field to explain what each role is for.Prefer roles over direct permissions
Prefer roles over direct permissions
Always assign permissions via roles, not directly to subjects.
API Reference
Create Role
Create a new role
Create Role Permission
Add a permission to a role
Create Role Assignment
Assign a role to a membership
Get Roles by Scope
List roles in a scope
Next Steps
Permissions
Learn how permissions define specific access rights