service.resource.verb (e.g., app.organization.update).
Permission Structure
Permissions typically correspond one-to-one with API methods. To call an API, the user must have the associated permission.You don’t grant permissions to users directly. Instead, you assign roles containing the appropriate permissions to users via policies.
Namespaces
A namespace is a logical container that organizes related permissions and resources. It provides:- Organization: Groups related entities together
- Scope: Defines the boundary of authorization
- Granularity: Enables fine-grained access control
Example Namespaces
app/organization- Organization management permissionsapp/project- Project-level permissionsapp/group- Group management permissionspotato/cart- Custom shopping cart permissionscompute/instance- Compute instance permissions
Predefined Permissions
Frontier includes predefined permissions for managing core resources.Organization Permissions
| Permission | Description |
|---|---|
app.organization.administer | Full administrative access to the organization |
app.organization.delete | Delete the organization |
app.organization.update | Modify organization details |
app.organization.get | View organization information |
app.organization.rolemanage | Manage roles within the organization |
app.organization.policymanage | Manage access control policies |
app.organization.projectlist | List projects in the organization |
app.organization.grouplist | List groups in the organization |
app.organization.invitationlist | List user invitations |
app.organization.projectcreate | Create new projects |
app.organization.groupcreate | Create new groups |
app.organization.invitationcreate | Create new invitations |
app.organization.serviceusermanage | Manage service users |
app.organization.billingmanage | Manage billing and purchases |
app.organization.billingview | View billing information |
Organization-level permissions cascade to projects, groups, and resources within that organization due to hierarchical inheritance.
Project Permissions
| Permission | Description |
|---|---|
app.project.administer | Full administrative access to the project |
app.project.delete | Delete the project |
app.project.update | Modify project details |
app.project.get | View project information |
app.project.policymanage | Manage project access policies |
app.project.resourcelist | List resources in the project |
Group Permissions
| Permission | Description |
|---|---|
app.group.administer | Full administrative access to the group |
app.group.delete | Delete the group |
app.group.update | Modify group details |
app.group.get | View group information |
Permission Hierarchy
Higher-level permissions include the capabilities of lower-level ones:app.organization.administer grants all other organization permissions.
Custom Permissions
Frontier superusers can create custom permissions for application-specific resources.When to Use Custom Permissions
Create custom permissions when:- Predefined permissions don’t meet your requirements
- You need resource-specific access control
- You’re integrating external services
- You want granular control over custom features
Creating Custom Permissions
Custom permissions can be created:- Dynamically via API while Frontier is running
- Declaratively in config using resource configuration files
Define Permission Requirements
Identify the namespace and actions needed for your resource
Example: Shopping Cart Permissions
Generate Permission Slugs
Frontier automatically generates slugs by combining namespace and name:
deleteinpotato/cart→potato_cart_deleteupdateinpotato/cart→potato_cart_updategetinpotato/cart→potato_cart_get
Permission Configuration File
Define custom permissions in YAML:potato-cart-permissions.yaml
config.yaml
Checking Permissions
To verify if a user has a specific permission on a resource, use the Check API:Resource Format
Theresource field accepts multiple formats:
User credentials are automatically extracted from the session, access token, or client ID/secret in request headers.
Managing Permissions via API
List Permissions
Retrieve all permissions, optionally filtered by namespace:Get Permission Details
Fetch a specific permission by ID or slug:Create Custom Permission
Create a new permission (superuser only):Update Permission
Update permission metadata:Delete Permission
Permission Name Parsing
Frontier automatically converts between different permission formats:Best Practices
Use Descriptive Names
Use Descriptive Names
Choose permission names that clearly indicate the action (e.g.,
delete, update, list) rather than vague terms.Follow Namespace Conventions
Follow Namespace Conventions
Use consistent namespace patterns like
service/resource to organize permissions logically.Leverage Hierarchies
Leverage Hierarchies
Design permission hierarchies where higher-level permissions include lower-level ones (e.g.,
administer > update > get).Document Custom Permissions
Document Custom Permissions
Add descriptive metadata to custom permissions to help administrators understand their purpose.
Test Permission Checks
Test Permission Checks
Always verify permission checks work as expected before deploying to production.
Next Steps
Roles
Create roles that bundle permissions together
Policies
Bind roles to users and resources with policies