Role Structure
How Roles Work
When a role is assigned to a user:- A policy is created binding the role to the user on a resource
- The user inherits all permissions from that role
- SpiceDB creates relationships between the role and permissions
- Permission checks traverse these relationships to determine access
Predefined Roles
Frontier includes several predefined platform-wide roles.Organization Roles
- Owner
- Manager
- Access Manager
- Viewer
app_organization_ownerFull administrative control over the organization and all resources within it.Permissions:app_organization_administer
The
administer permission hierarchically includes all other organization permissions.Project Roles
| Role | Permissions | Description |
|---|---|---|
app_project_owner | app_project_administer | Full project administrative access |
app_project_manager | app_project_updateapp_project_getapp_project_resourcelistapp_organization_projectcreateapp_organization_projectlistapp_organization_grouplist | Manage project details and resources |
app_project_viewer | app_project_get | Read-only project access |
Group Roles
| Role | Permissions | Description |
|---|---|---|
app_group_owner | app_group_administer | Full group administrative access |
app_group_member | app_group_get | View group information |
Billing Role
| Role | Permissions | Description |
|---|---|---|
app_billing_manager | app_organization_billingviewapp_organization_billingmanage | Manage organization billing |
Custom Roles
Create custom roles to meet specific authorization requirements beyond predefined roles.Platform vs Organization Roles
- Platform Roles
- Organization Roles
Created by: Frontier superusersScope: Available across all organizationsUse case: Standard roles used organization-wideOrgID: Empty string
Creating Custom Roles
Identify Required Permissions
Determine which permissions the role needs. Use permission slugs like
potato_cart_update.Example: Shopping Cart Manager
Let’s create a custom role for managing shopping carts:Create Organization Role
Permission slugs must exist before being added to a role. Create custom permissions first if needed.
Role States
Roles can be in one of two states:- Enabled
- Disabled
Status:
enabledThe role is active and can be assigned to users via policies. Users with this role can exercise its permissions.Deactivating a Role
Temporarily disable a role without deleting it:Reactivating a Role
Re-enable a disabled role:Managing Roles via API
List Organization Roles
Retrieve custom roles created within an organization:List All Org Roles
List Enabled Roles Only
This endpoint only returns organization-specific custom roles. Platform-wide default roles are not included.
List Platform Roles
Retrieve all predefined platform-wide roles:Create Organization Role
Create a custom role scoped to an organization:Update Organization Role
Modify an existing custom role:Updating a role’s permissions automatically updates SpiceDB relationships for all existing policy assignments.
Delete Organization Role
Role Implementation Details
When a role is created in Frontier:1. Role-Permission Relations Created
For each permission in the role, Frontier creates SpiceDB relations:* wildcard means “all users who have this role will have these permissions.”
2. Dynamic Permission Updates
When updating a role:3. Role Deletion Process
Deleting a role:- Removes all SpiceDB relations for the role
- Deletes all policies using the role (cascading delete)
- Removes the role from the database
- Creates audit record of deletion
Best Practices
Use Predefined Roles When Possible
Use Predefined Roles When Possible
Leverage built-in roles like
app_organization_owner before creating custom roles. They’re battle-tested and cover common scenarios.Follow Least Privilege Principle
Follow Least Privilege Principle
Grant only the minimum permissions required. Create narrow, focused roles rather than overly permissive ones.
Use Descriptive Names
Use Descriptive Names
Choose clear role names that indicate purpose (e.g.,
billing_viewer, project_deployer) rather than vague terms.Document Custom Roles
Document Custom Roles
Always add metadata with descriptions explaining the role’s purpose and intended users.
Prefer Disabling to Deleting
Prefer Disabling to Deleting
Temporarily disable roles instead of deleting them when access needs to be revoked. This preserves audit history.
Review Role Permissions Regularly
Review Role Permissions Regularly
Periodically audit custom roles to ensure permissions still match organizational needs.
Next Steps
Policies
Learn how to assign roles to users via policies
Examples
See real-world role usage patterns