Uploaded image for project: 'Reference Application'
  1. Reference Application
  2. RA-1903

System Developer role should have privileges to modify patient Enrollment

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • Reference Application 2.11.0
    • Core Apps
    • 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 .

       

      Gliffy Diagrams

        Attachments

          Activity

            People

              luis.oliveira luis Oliveira
              ifernandes Ines Fernandes
              Daniel Kayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: