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