Custom Roles

Available on the following plans

PremiumUltimateEnterprise

About Custom Roles

By default, Userfront has a list of roles that are applicable across a variety of use cases.

However, there may be instances where you want to use roles that are tailored specifically to your application, or whose names correspond to specific resources in your system.

In these instances, you can create custom roles via the Userfront dashboard or API.

See also Role-Based Access Control (RBAC)

A form for creating custom role in role-based access control (RBAC)

Custom Role Requirements

Role names can be any string of characters from 1 to 100 characters in length and cannot begin or end with a whitespace. There are no other restrictions on custom role names.

Attribute
Requirement
Minimum length
1 character
Maximum length
100 characters
Character restrictions
Cannot begin or end with whitespace

When creating a role, the casing of each character is preserved. For example, creating an “Administrator” role will cause all authorization objects created by Userfront to contain roles: ["Administrator"] with the uppercase “A” preserved.

Role names cannot be edited once they have been created.

{
  "email": "bgates@example.com",
  ...
  "authorization": {
    "wbmxvmvn": {
      "tenantId": "wbmxvmvn",
      "name": "Organization A",
      "roles": ["Administrator", "custom_role-name 33"]
    }
  }
}

Custom Role Handling

Once created, custom roles are handled the same way as other roles on Userfront.

The Roles page allows for direct creation and deletion of roles in the Userfront dashboard, either at the global application level, or for individual tenants within your workspace.

A page for creating and managing custom roles with RBAC

You can also assign roles to an existing user, or create or invite a user to join your application with the roles that you provide.

A page for assigning roles with RBAC