Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
Reference Application 2.11.0
-
None
-
Low
Description
After making some tests with role System Developer (SUPERUSER), it was noticed that a user with this role cannot Enroll Patient in Program and cannot Edit and/or Delete patient enrollment. On the below image the buttons to enroll, edit and delete are missing:
After a little investigation on coreapps widgets controllers for program and programstatus, it seems there is a part of the code that is fetching current user privileges through openmrsREST to give, or not, privileges to these buttons on program and programstatus widgets. Check code here and here
When calling openmrsREST the response for this role (System Developer) is:
The privileges array is empty so conditions like the one below will never be true for this SUPERUSER.
if (response.user.privileges.some( (p) => { return p.name === 'Task: coreapps.enrollInProgram'; })) { this.canEnrollInProgram = true;};
Meaning that SUPERUSER can never enroll a patient and can never edit or delete a patient previsously enrolled.
This is happening also for relationships widget. Check code here .