Edit Privilege on VisitSummary Page

Hello everyone,

Currently the Visit summary Page has 2 links that do not have any privilege associated:

  • Edit Visit
  • Edit Date

You can see that here:

There is a canEditVisit on the code above, but this is a condition that checks if there are several VisitTypes. If more than 1, then the link Edit Visit is shown. You can confirm this here and here

So I was wondering that maybe it makes sense to create a privilege for showing these 2 links. Only the roles that have this privilege should be able to edit the date and the visit type.

Solution would be something like:

[[ if (canEditVisit) { ]]
    <a class="right" id="editVisitDatesLink" href="#" data-visit-id="[[= id]]">${ ui.message("coreapps.task.editVisitDate.label")}</a>
    [[ if (mutipleVisitTypes) { ]]
	    <span class="right"> | </span>
        <a class="right" id="editVisitLink" href="#" data-visit-id="[[= id]]">${ ui.message("coreapps.task.editVisit.label")}</a>
    [[ } ]] 
[[ } ]]

where current boolean, canEditVisit, would be transformed into mutipleVisitTypes and a new privilege is created to edit the visit, like already exists to delete Visit (here, here and here)

Let me know your thoughts about this.

Thanks!

CC: @mksd

1 Like

I’m good with this, others? @ssmusoke @mogoodrich?

We don’t use this functionality, so I don’t have a strong preference, but agree that it would make sense to have a privilege for this.

The annoying thing is that this would change the default functionality… ie, once this change is in place no one would be able to edit visits until they were given this new privilege. Again, not a big deal on my end because we don’t really use this, but might be an issue for others.

Take care, Mark

Thanks @ifernandes for this catch, do you mind creating a ticket in jira to track this change

Thank you @sharif. I’ve opened RA-1872.

1 Like