Skip to main content
A member’s role decides what they can change in an organization. Every organization has three built-in roles. Admins can also define custom roles, each a set of permissions picked from a catalog, and can limit a custom role to devices with certain tags. A member holds one role in each organization: a built-in role or a custom role, never both.

Requirements

Custom roles and tag-scoped roles need NervesHub 2.5.4 or later.
If you self-host, do not roll back to NervesHub 2.5.3 once any member holds a custom role. 2.5.3 does not know about custom roles, so that member has no role it understands. Finish a rolling deploy to 2.5.4 before you give anyone a custom role.

Built-in roles

To see exactly what a role grants, open the Roles tab of your organization and click the role’s name.

Permission catalog

Each permission first appears at one built-in role. Every role above it has it too. The Permission column is the label on the role form. The identifier is the name other pages in these docs use when they say which permission an action needs.

Custom roles

A custom role is a name, an optional description and a set of permissions.
  • Every custom role can view the organization’s products, devices and settings. You do not pick that.
  • You pick what the role can change, from the permissions that Manage has.
  • Permissions that only Admin has cannot be given to a custom role.
  • Run support scripts on devices is optional for a custom role, although the built-in View role has it.
  • Creating a deployment group also needs Create, edit and approve releases, because a group starts with a release.

Create a custom role

You need the built-in Admin role.
1

Open the Roles tab

Open your organization and select the Roles tab.
2

Add a role

Click Add role. Enter a Name and, optionally, a Description. The name cannot be the name of a built-in role.
3

Pick permissions

Tick what the role can change. To start from an existing set, use Copy permissions from and choose Manage or another custom role.
4

Save

Click Create role.

Give a member a custom role

On the Users tab, change the member’s role in the Role column. Custom roles are listed under Custom roles. You can also choose a custom role in the Role field when you invite someone.

Edit or delete a custom role

On the Roles tab, click Edit or Delete beside the role. An edit applies straight away. Pages the role’s members have open reload with the new permissions. Consoles, local shells and device event streams that the role no longer allows close. You can only delete a role that nobody uses. While a member holds the role or an outstanding invite offers it, move them to another role first.

Roles limited to tagged devices

A custom role can be limited to devices with certain tags. Its members see only those devices, wherever devices are listed or opened. To limit a role, fill in Only devices tagged on the role form and choose the Tag matching:
  • Require all matches only devices that have every tag.
  • Allow any matches devices that have at least one of the tags.
Leave the tags empty for a role that sees every device in the organization. A tag-scoped role has these limits:
  • It can only be given permissions that act on a single device: editing, tagging, deleting, restoring and destroying a device, the remote console, the local shell, identify, reboot, reconnect, pushing firmware, turning updates on or off, clearing the penalty box, moving the device into a deployment group, and running support scripts.
  • Pages built from all of a product’s devices are closed to its members. That includes Insights, deployment groups, firmware, archives, errors, product notifications and product settings.
  • When a tag change takes a device out of a member’s reach, the console, shell or device page they have open for it closes.

Roles and the API

The JSON API checks the same permissions as the web UI. A user access token acts with that user’s role in each organization.
  • Reads need only membership of the organization.
  • A member of a tag-scoped role sees only the devices its tags match through the API too. Endpoints built from all of a product’s devices, such as firmware, archives, deployment groups and releases, refuse them.
The member endpoints handle custom roles as follows:
  • GET /api/orgs/{org_name}/users and GET /api/orgs/{org_name}/users/{user_email} return each member’s role as admin, manage or view. For a member with a custom role, role is null and the role’s name is in custom_role.
  • The API’s invite and role update endpoints accept only the built-in roles. Assign custom roles in the web UI. The same applies to nh org invite and nh org set-role.
Product API keys, which hold a role of their own, are on the main branch but in no tagged release as of NervesHub 2.5.4. See CI/CD.