Edit or clone a role
Overview
Only a superuser can edit or clone a role. No role gives this access to other users.
This flow describes how to change a role that is not a system role. It also describes how to clone a role, which creates a new role from a copy of an existing one.
Care comes with default roles, such as Doctor and Nurse. These are system roles. You cannot edit or delete a system role, but you can clone it and change the copy.
Care has no screen to delete a role.
Pre-requisites
- You are signed in to Care with a superuser account.
- The role is on the Roles page.
- If you edit the role, it is not a system role.
Permissions
| Permission | Access |
|---|---|
| Superuser account | Opens the Roles page on the Admin Dashboard and lets you edit a role that is not a system role, or clone any 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.
2. Find the role
Each role shows as a card, with its name, its description, a badge for each context and the number of permissions.
A system role shows a lock icon before its name and a System badge.
To find the role, use these controls:
| Components | What it captures |
|---|---|
| Search Roles | Shows the roles whose name contains the text that you type. |
| All | Shows all roles. |
| Facility | Shows the roles that have the Facility context. |
| Government Organization | Shows the roles that have the Government Organization context. |
| Responsibility | Shows the roles that have the Responsibility context. |
The page shows 15 roles at a time, the newest first. If there are more than 15 roles, use the page buttons below the cards.
If no role matches, the page shows No roles found and Adjust role filters.
3. Open the Actions menu
On the card of the role, select Actions, the three-dot button.
The menu shows Edit and Clone. For a system role, the menu shows only Clone.
To edit the role, go to step 4. To clone the role, go to step 5.
4. Edit the role
Select Edit.
Care opens the Edit Role form, with the line Update role name, contexts, and permissions. The form shows the current values of the role.
Change the Name, the Description, the Contexts or the Permissions. Each field has the same rules as when you create a role. See Create a role.
The name must be different from the name of each other role. Care ignores upper and lower case when it compares names.
Select Update Role. The button is available only after you change a value.
Care shows Role updated successfully.
Care replaces the permissions of the role with the permissions that you selected.
If another role has the same name, Care shows an error message and does not save the change. Enter a different name.
To close the form without saving, select Cancel.
5. Clone the role
Select Clone. You can clone any role, including a system role.
Care opens the Add Role form. The name is the name of the original role, followed by "(Copy)". The form has the description, the contexts and the permissions of the original role.
Change the name. Change the other values as necessary.
Select Create Role.
Care shows Role created successfully.
If a role with the same name already exists, Care shows an error message and does not create the role. This happens if you clone the same role two times and keep the name. Enter a different name.
Expected Outcome
- After an edit, the role has the name, the description, the contexts and the permissions that you saved.
- After a clone, Care adds a new role to the Roles page. It has no System badge, so you can edit it later.
- After a clone, the original role does not change.
Related
Concepts:
Flows: