Roles

Map users and groups to roles, and set what each role may do.

  1. The roles attribute
  2. The default role
  3. Role object
  4. Role options

The roles attribute

The top-level roles list of config.yaml:

Attribute Comments
roles
array

Roles
đź”— valid role object

The roles provide RBAC. Each role has a name and 1 or more groups (local, ldap or entraid). The admin and default roles are mandatory (public is the old name of default, and still works).
Since version 4.0.11 you can also add users (local, ldap or entraid).
Since version 5.0.8 options are introduced to add specific role-options.

  • showDesigner: The user can see the designer
  • allowFormDesign: The user can edit the forms config in the designer (categories, constants, forms: save, restore, pull and push the forms repositories). Without it the designer shows them read-only. Default true. (Added in 7.3.0)
  • allowPlaybookDesign: The user can edit the playbooks in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.0.0)
  • allowWorkflowDesign: The user can edit the workflows in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.1.0)
  • allowInventoryDesign: The user can edit the inventories in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.1.0)
  • allowVarsFileDesign: The user can edit the vars files in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.1.0)
  • showSettings: The user can see the settings page
  • showDebugButtons: The user can see the debug buttons on a form
  • showExtravars: The user can see the extravars on a form
  • showLogs: The user can see the server log (Settings > Server log)
  • showAuditLog: The user can see the audit log (Settings > Audit log) without the other settings. Default: admins. (Added in 7.3.0)
  • showAppearanceSettings: The user can change Settings > Appearance (defaults, name, logo, icon, links, environment label, announcements) without the other settings. Default false. (Added in 7.3.0)
  • showConnectionsSettings: The user can manage Settings > Connections (repositories, credentials, secret stores, runners, SSH, notifications, chat assistant, MCP, syslog) without the other settings. Default false. (Added in 7.3.0)
  • showJobs: The user can see the jobs page. Default true.
  • showArtifacts: The user can see the artifacts an AWX job returns. Default true.
  • allowFileUploads: The user can upload files through a form’s file fields. Without it the field is read-only and the upload is refused. Default true. (Added in 7.3.0)
  • allowApiTokens: The user can make API tokens (Profile > API token), living up to API_TOKEN_MAX_DAYS. Default false (true for a role that only sets extendedTokenExpiration, as before this option). (Added in 7.3.0)
  • extendedTokenExpiration: With allowApiTokens, the user can also make API tokens that never expire. Default false.
  • showAllJobLogs: The user can see all job logs (not only his own) (Added in 5.0.9)
  • allowLogin: The user can login.
  • allowBackupOps: The user can perform database operations, such as backup and restore.
  • allowVerboseMode: The user can enable verbose mode on ansible forms.
  • allowJobRelaunch: The user can relaunch jobs with pre-filled form data from previous submissions.
  • allowJobDeletion: The user can delete jobs (their own ; an admin every job). Without it the job history stays whole. Default true. (Added in 7.3.0)
  • manageAllJobs: The user can abort, delete and relaunch the jobs of every user, not only their own, without the admin role (delete and relaunch also need allowJobDeletion and allowJobRelaunch). Default: admins. (Added in 7.3.0)
  • allowScheduledJobs: The user can create and manage scheduled jobs (recurring cron or one-time). Default for admins only. Grant it only to roles you would trust as admins: every user with this option sees and can change all schedules, not only their own, and a schedule they create runs with admin rights, for any form. (Added in 6.1.5)
  • allowStoredJobs: The user can store and load job data for later use. (Added in 6.1.5)
  • allowPlannedJobs: The user can plan a one-time run of a form they may run (“Run later”). The job runs as that user, not as admin, and they cannot see or change other schedules. (Added in 6.1.5)
  • allowChat: The user can use the chat assistant (when it is enabled). Default true. (Added in 6.5.0)
  • allowMcp: The user can use the MCP server from an AI agent (when it is enabled). Defaults to the role’s allowChat. (Added in 7.0.0)

When options are not set, the admin role will have all options.
When options are set on the default role, they are everyone’s defaults: they have the lowest precedence and only fill the options none of the user’s own roles set.
You can add options on role level, which override the default role’s options. Between a user’s own roles the most restrictive wins (an option false on one of them is false).
The default role is every signed-in user’s ; there is no anonymous access. public is its name before 7 and keeps working (forms listing public still match), but new configs say default.

The allowLogin option is different, that is for the backend. By default everyone can login.
You can set it to false on default and then enable on the roles you want to give access. Watch out you don’t lock yourself out.

Examples:

1) Roles

roles:
- name: admin        # is mandatory
  groups:
  - local/admins
  - ldap/Domain Admins
  - entraid/Domain Admins
- name: operator
  groups:
  - local/operator
- name: architect
  groups:
  - local/architect
  options:
    showDesigner: true      # architects can see the designer
    showLogs: true          # architects can see the logs
    allowJobRelaunch: true  # architects can relaunch jobs with pre-filled data
- name: demo
  groups:
  - local/demo
- name: usersonly
  users:
  - local/myuser
- name: default        # is mandatory
  groups: []  
  options:
    showDebugButtons: true  # everyone can see the debug buttons
    showExtraVars: true     # everyone can see the extravars

The default role

Every signed-in user has the default role, so a form with roles: [default] is open to everyone who can sign in. There is no anonymous access: nobody gets this role without signing in.

The role holds no groups and no users, since it already applies to everyone. Its options are everyone’s defaults, as described under Role options below. config.yaml must have an admin and a default role, and the roles page shows both as Required.

default was called public before 7.0.0, and the old name keeps working:

  • In a form, roles: [public] still matches every user, so forms in your repositories need no change.
  • In config.yaml, a role called public is renamed default in the file when the config loads. Only the name changes, a backup of the config is taken first, and a config kept in a repository then has a change to push.
  • In a ytt template, the template is not rewritten: the config it produces is renamed, and a warning in the log asks you to rename the role in the template too. Version 8 refuses a public role there.

A config with both a default and a public role is refused, because they are the same role.


Role object

Each entry of the roles list:

A role allows RBAC. Each role has 1 or more groups (local or ldap). Except the default role (public its old name), which has no groups.
The default and admin roles are mandatory.

Attribute Comments
name
string / required / unique

The name of the role
alphanumeric + dash + underscore + space

The name of a role has to be unique. The default and admin roles are mandatory.

groups
array / required

Groups
A group (local, ldap or entraid)

A list of groups. They must be in the format of local/groupname or ldap/groupname or entraid/groupname

A Microsoft Entra ID group can be named by its object id, entraid/<object id>: unique, where two groups can share a display name. Both work ; the object id is the one to prefer.

azuread/, the Microsoft Entra ID prefix of before 7.3, still works the same as entraid/ (deprecated, removed in 8.0) ; the roles editor writes entraid/.

users
array / required
added in version 4.0.10

User
A user (local, ldap or entraid)

A list of local or ldap users. They must be in the format of local/username or ldap/username or entraid/username (azuread/username before 7.3, still accepted)

credentials
array
added in version 7.0.0

The credentials this role may use
regular expressions, matching a whole credential name

Limits the credentials a user of this role may use: those a job passes to a playbook or a template (the form’s credentials, ansibleCredentials, vaultCredentials, a credential field), and those a form query or fnCredentials reads while the user fills in a form. Each entry is a regular expression that must match the whole name ; __self__ is AnsibleForms’ own database.

A user none of whose roles lists credentials may use every credential, as before. Once one of their roles lists them, they may use what any of the roles that list them allows. The admin role is never limited. A launch that needs a credential the roles do not allow is refused before the job is created.

secretStores
array
added in version 7.0.0

The secret stores this role may read inline
secret store names

Limits the secret stores a user of this role may read through an inline reference (vault:<path>, secret:<store>:<ref>) in a credential map, a query or fnCredentials. When a role limits the credentials and none limits the stores, an inline reference must match a credential pattern itself: it is no way around them. Combined across roles as credentials.

runners
array
added in version 7.0.0

The runners this role may run jobs on
runner names

Limits the runners a job of a user of this role may run on: the form’s runner, or the default runner when it names none. Combined across roles as credentials.

options
object
added in version 5.0.8

Role options
Key value pairs

Since version 5.0.8 you can add specific role options. The options are used to enable or disable certain features for a role.
The options are:

  • showDesigner: The user can see the designer
  • allowFormDesign: The user can edit the forms config in the designer (categories, constants, forms: save, restore, pull and push the forms repositories). Without it the designer shows them read-only. Default true. (Added in 7.3.0)
  • allowPlaybookDesign: The user can edit the playbooks in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.0.0)
  • allowWorkflowDesign: The user can edit the workflows in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.1.0)
  • allowInventoryDesign: The user can edit the inventories in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.1.0)
  • allowVarsFileDesign: The user can edit the vars files in the designer (save, new, remove, push). Without it the designer shows them read-only. Default true. (Added in 7.1.0)
  • showSettings: The user can see the settings page
  • showDebugButtons: The user can see the debug buttons on a form
  • showExtravars: The user can see the extravars on a form
  • showLogs: The user can see the server log (Settings > Server log)
  • showAuditLog: The user can see the audit log (Settings > Audit log) without the other settings. Default: admins. (Added in 7.3.0)
  • showAppearanceSettings: The user can change Settings > Appearance (defaults, name, logo, icon, links, environment label, announcements) without the other settings. Default false. (Added in 7.3.0)
  • showConnectionsSettings: The user can manage Settings > Connections (repositories, credentials, secret stores, runners, SSH, notifications, chat assistant, MCP, syslog) without the other settings. Default false. (Added in 7.3.0)
  • showJobs: The user can see the jobs page. Default true.
  • showArtifacts: The user can see the artifacts an AWX job returns. Default true.
  • allowFileUploads: The user can upload files through a form’s file fields. Without it the field is read-only and the upload is refused. Default true. (Added in 7.3.0)
  • allowApiTokens: The user can make API tokens (Profile > API token), living up to API_TOKEN_MAX_DAYS. Default false (true for a role that only sets extendedTokenExpiration, as before this option). (Added in 7.3.0)
  • extendedTokenExpiration: With allowApiTokens, the user can also make API tokens that never expire. Default false.
  • showAllJobLogs: The user can see all job logs (not only his own) (Added in 5.0.9)
  • allowLogin: The user can login.
  • allowBackupOps: The user can perform database operations, such as backup and restore.
  • allowVerboseMode: The user can enable verbose mode on ansible forms.
  • allowJobRelaunch: The user can relaunch jobs with pre-filled form data from previous submissions.
  • allowJobDeletion: The user can delete jobs (their own ; an admin every job). Without it the job history stays whole. Default true. (Added in 7.3.0)
  • manageAllJobs: The user can abort, delete and relaunch the jobs of every user, not only their own, without the admin role (delete and relaunch also need allowJobDeletion and allowJobRelaunch). Default: admins. (Added in 7.3.0)
  • allowScheduledJobs: The user can create and manage scheduled jobs (recurring cron or one-time). Default for admins only. Grant it only to roles you would trust as admins: every user with this option sees and can change all schedules, not only their own, and a schedule they create runs with admin rights, for any form. (Added in 6.1.5)
  • allowStoredJobs: The user can store and load job data for later use. (Added in 6.1.5)
  • allowPlannedJobs: The user can plan a one-time run of a form they may run (“Run later”). The job runs as that user, not as admin, and they cannot see or change other schedules. (Added in 6.1.5)
  • allowChat: The user can use the chat assistant (when it is enabled). Default true. (Added in 6.5.0)
  • allowMcp: The user can use the MCP server from an AI agent (when it is enabled). Defaults to the role’s allowChat. (Added in 7.0.0)

When options are not set, the admin role will have all options.
When options are set on the default role, they will have the lowest precedence and can be used as default options for all roles.
You can add options on role level, which will override the default role options.

Examples

1) Roles

roles:
- name: admin        # is mandatory
  groups:
  - local/admins
  - ldap/Domain Admins
- name: operator
  groups:
  - local/operator
  users:
  - entraid/mike
- name: architect
  groups:
  - local/architect
  options:
    showDesigner: true # architects can see the designer
    showLogs: true     # architects can see the logs
- name: demo
  groups:
  - local/demo
- name: default        # is mandatory
  groups: []  
  options:
    showDebugButtons: true  # everyone can see the debug buttons
    showExtraVars: true     # everyone can see the extravars              

Role options

The options of a role switch features on or off for its members. From 7.3.0 the role’s page shows them in four groups, each option with an (i) that says what it gives, the same text the Permissions view of the profile shows:

Option Allows the user to Default
Settings    
showSettings See and change every settings page; the server log and backups have their own options Admins only
showAppearanceSettings Change the appearance settings, without the other settings (from 7.3.0) Off
showConnectionsSettings Manage the connections settings (credentials, runners and more), without the other settings (from 7.3.0) Off
showLogs See the server log Admins only
showAuditLog See the audit log, without the other settings (from 7.3.0) Admins only
allowBackupOps Back up and restore the database Admins only
Designer    
showDesigner See and use the designer Admins only
allowFormDesign Edit the forms config in the designer: categories, constants and forms. Without it, read-only (from 7.3.0) On
allowPlaybookDesign Edit the playbooks in the designer: save, create, remove and push them. Without it, read-only On
allowWorkflowDesign Edit the workflows in the designer: save, create, remove and push them. Without it, read-only On
allowInventoryDesign Edit the inventories in the designer: save, create, remove and push them. Without it, read-only On
allowVarsFileDesign Edit the vars files in the designer: save, create, remove and push them. Without it, read-only On
Jobs    
showJobs See the jobs page On
showAllJobLogs See the jobs of every user, not only their own Admins only
manageAllJobs Abort, delete and relaunch the jobs of every user; deleting and relaunching also need the two options below (from 7.3.0) Admins only
showExtravars See the extravars of a form and of a job On
showDebugButtons See the debug buttons on a form On
showArtifacts See a job’s artifacts: what an AWX job returns, or what a playbook gathered with set_stats On
allowVerboseMode Run jobs in verbose mode On
allowJobRelaunch Relaunch a job with the form data of an earlier run Admins only
allowJobDeletion Delete jobs: their own, or every user’s with manageAllJobs. Without it, the job history stays whole (from 7.3.0) On
allowScheduledJobs Create and manage recurring and one-time schedules, on the Schedules page (see the warning below) Admins only
allowPlannedJobs Plan a job to run once at a set time (Run later) On
allowStoredJobs Store the data of a form and load it again later On
Access and integrations    
allowLogin Sign in to AnsibleForms On
allowChat Use the chat assistant, when it is enabled On
allowMcp Use the MCP server from an AI agent, when it is enabled The role’s allowChat
allowFileUploads Upload files through a form’s file fields (from 7.3.0) On
allowApiTokens Make API tokens for scripts, up to the longest lifetime the instance allows (from 7.3.0) Off
extendedTokenExpiration Also make API tokens that never expire; it needs allowApiTokens Off

Some options include others, and the role’s page shows the included ones on and greyed out:

  • showSettings gives showAppearanceSettings, showConnectionsSettings and showAuditLog too.
  • manageAllJobs gives showAllJobLogs too, as acting on every user’s jobs means seeing them.
  • The design options only matter with showDesigner, and extendedTokenExpiration only with allowApiTokens.

Up to 7.2.0, showAllJobLogs also let a user abort and delete the jobs it showed; from 7.3.0 that takes manageAllJobs. A role from before 7.3.0 with extendedTokenExpiration and without allowApiTokens gets allowApiTokens, so it keeps its tokens.

Admins only means on for users who hold the admin role, and off for everyone else. When a user matches several roles, the options are combined as follows:

  • Between the user’s roles, an option is on only when every role that sets it agrees: an explicit false wins.
  • The default role fills in the options that none of the user’s other roles set, so it can hold defaults for everyone.
  • Options set nowhere take the default from the table.

showExtraVars, with a capital V, is accepted as another spelling of showExtravars; when either spelling is false, the option is off.

Treat allowScheduledJobs as an admin-level option. Schedules are not owned by the user who created them: every user with the option sees and can change all schedules. A schedule also runs with admin rights, for any form, whatever the creator’s own access. Grant it only to roles you would trust as admins.

allowLogin: false on the default role locks out every user whose other roles do not set allowLogin: true, including the admins. Grant it back on the roles that must sign in before you save.