# Create a role

## Overview

[Video: Create a role](https://www.youtube.com/watch?v=HL2kyhqxIM0)

info

Only a superuser can create a role. No role gives this access to other users.

This flow describes how to create a new [role](https://docs.ohc.network/concepts/access-governance/access-control.md) in Care. A role is a named set of permissions. Users give the role to people in a department, a government organization or a responsibility.

You choose the name of the role, the places where Care offers it, and the permissions that it gives. Care comes with default roles, such as Doctor and Nurse.

## Pre-requisites

* You are signed in to Care with a superuser account.
* No other role has the name that you want to use.

## Permissions

| Permission | Access |
| - | - |
| Superuser account | Opens the **Roles** page on the Admin Dashboard and lets you create a role. No role or permission gives this to other users. |

## Steps

### 1. Open the Roles page

On your dashboard, select **Admin Dashboard**. Care opens the Admin Dashboard, with the admin sidebar.

In the admin sidebar, under **Administration**, select **RBAC**. Then select **Roles**.

Care opens the **Roles** page. It shows each role as a card.

![The Add Role button on the Roles page of the Admin Dashboard](/assets/images/create-role-1-ea17670f1acbd2d3d74fd40eac85b7c1.webp)

### 2. Open the Add Role form

Select **Add Role** at the top of the page.

Care opens the **Add Role** form, with the line **Create a new custom role with specific permissions**.

![The Add Role form](/assets/images/create-role-2-558d2c2a23c279090a79a565415dc6d5.webp)

### 3. Enter the name and the description

| Components | What it captures |
| - | - |
| **Name** | The name of the role. Required. The name must be different from the name of each other role. Care ignores upper and lower case when it compares names. |
| **Description** | What the role is for. Optional. Care shows it on the role card and in the lists where users give a role. |

![The name and the description of the new role in the Add Role form](/assets/images/create-role-3-9b5dbdd900409f70d0fb9f9e0adf74a5.webp)

### 4. Select the contexts

Under **Contexts**, select the places where Care offers the role.

| Components | What it captures |
| - | - |
| **Facility** | Care offers the role when a user gives a role in a department, and in the care team of a patient. |
| **Government Organization** | Care offers the role when a user gives a role in a government organization. |
| **Responsibility** | Care offers the role as a **Designation** in a responsibility. |

Care selects **Facility** and **Government Organization** for a new role. Change them as necessary.

Select at least one context.

![The contexts of the new role, with Facility selected and Government Organization cleared](/assets/images/create-role-4-4facea5bdd64980b4fd0f0346f6d56fb.webp)

### 5. Select the permissions

Under **Permissions**, Care lists every permission, with its name and a description.

Select the check box of each permission that the role gives.

* To find a permission, type a part of its name in **Search permissions**.
* If no permission matches your search, the list shows **No permissions match your search**.
* To select every permission, empty the search box first. Then select **Select All**.
* To clear all the permissions that you selected, select **Clear**.

Next to **Permissions**, Care shows the number of permissions that you selected, followed by **Selected**.

Select at least one permission.

![Two permissions selected after a search for patient](/assets/images/create-role-5-5364899548532ca8cc6629a500dcf155.webp)

### 6. Create the role

Select **Create Role**.

Care shows **Role created successfully**. Care closes the form and loads the list of roles again.

If a value is not correct, Care does not create the role:

* If **Name** is empty or has only spaces, Care shows **This field is required**.
* If you selected no context, Care shows **Select at least one context**.
* If you selected no permission, Care shows **At least one permission is required**.
* If another role has the same name, Care shows an error message. Enter a different name.

To close the form without saving, select **Cancel**.

![The card of the new role on the Roles page](/assets/images/create-role-6-4c021a5756d6c14c3c9f4b297f065950.webp)

## Expected Outcome

* Care adds the role to the **Roles** page. The list shows the newest roles first.
* The role card shows the name, the description, a badge for each context and the number of permissions.
* The card has no **System** badge, so you can edit the role later.
* Care offers the role in the role lists of the places that its contexts name.

## Related

Concepts:

* [Roles and Permission](https://docs.ohc.network/concepts/access-governance/access-control.md)

Flows:

* [Edit or clone a role](https://docs.ohc.network/flows/access-governance/access-control/edit-or-clone-role.md)
* [View the permissions matrix](https://docs.ohc.network/flows/access-governance/access-control/view-permissions-matrix.md)
* [Assign a role to a user](https://docs.ohc.network/flows/access-governance/access-control/assign-role-to-user.md)
