Skip to main content
Version: 3.1

Roles and permissions

Definition

Roles and permissions decide who can do what in Care, and where. A permission is one action, such as "Can Create Patient". A role is a named set of permissions, such as Doctor. You give a user a role inside one boundary, such as a facility or an organization. A user has no access of their own. All access comes from the roles that the user holds.

Key Attributes

ComponentsWhat it captures
PermissionOne action that a user can do. Care declares each permission in code, and you cannot change the list.
RoleA named set of permissions, such as Doctor or Nurse.
ContextsThe boundary types that the role applies in: Facility, Government Organization, or Responsibility.
SystemThe mark on a role that Care supplies. You cannot edit or delete a system role.
DescriptionFree text that explains the purpose of the role.

Permission

Care declares every permission in code, then loads it into the database. You cannot create, edit, or delete a permission. Each permission has a name, such as "Can Manage Users in an Organization", and a context that names the kind of record it applies to.

A permission applies only inside its own context. A permission on a patient does not give access to a facility, because the two use different contexts.

ContextApplies to
GenericActions that are not tied to one kind of record
FacilityA facility
PatientA patient
EncounterOne encounter
OrganizationA government organization or a responsibility organization
Facility organizationA department or a team inside a facility
QuestionnaireA questionnaire

Role

A role is a flat set of permissions. The name of a role carries no meaning of its own. Doctor and Nurse are two different permission sets, and nothing more.

Care supplies the roles in the table below. You can add your own roles, and you can copy a system role to start from. A role must hold at least one permission, and the name of a role must be unique.

RolePurposeContexts
DoctorDoctor at some facilityFacility, Government Organization
NurseNurse at some facilityFacility, Government Organization
StaffStaff at some facilityFacility, Government Organization
VolunteerVolunteer at some facilityFacility, Government Organization
PharmacistPharmacist at some facilityFacility
AdministratorAdministrator at a given boundaryFacility, Government Organization
Facility AdminAdministrator of a facility, given to the person who creates the facilityFacility
AdminAdministrator at the top of the treeFacility, Government Organization
AdminAdministrator of a responsibility organizationResponsibility
ManagerManager of a responsibility organizationResponsibility
MemberMember of a responsibility organizationResponsibility

Two system roles use the name Admin. The contexts of the role keep them apart.

Contexts

The contexts of a role name the boundary types that you can use the role in. Care shows only the roles that match the boundary when you give a role to a user. A responsibility organization offers only the responsibility roles.

How a user gets access

You give a user a role in one organization, one facility, or one department. The grant reaches the records below that point in the tree. A role at a district reaches every facility in that district. A role at one facility reaches only that facility and its departments.

A user can hold many roles at the same time. The access of the user is the sum of all the roles that reach the record. A grant can also carry an expiry date, after which the grant ends.

You cannot give a user a role that holds more permissions than you hold yourself at that boundary.

Permissions

The permissions below control the roles and permissions themselves.

PermissionDescriptionSystem Roles
Can Manage Users in an OrganizationAdd a user to an organization, change the role of a user, and remove a user.Admin, Administrator, Facility Admin, Admin (responsibility)
Can Manage Connected Role OrganizationsManage the users of the responsibility organizations that this organization manages.Admin (responsibility), Manager (responsibility)
Can List Users in an OrganizationsSee the users of an organization and the role of each user.Facility Admin, Admin, Staff, Doctor, Administrator, Nurse, Volunteer, Pharmacist, Admin (responsibility), Manager (responsibility)

Only a super user can create, change, or delete a role. Every signed-in user can read the list of roles and the list of permissions.

note

Care refuses a change to a system role, and it refuses a request to delete a system role.