When an enrollment is deleted users are unable to re-enter or search that particular record with a deleted enrollment, is there a way to hide the delete button on the enrollment widget?
Hey @duserik,
May I ask what is the version of the DHIS2 instance you are using? Have you tried creating roles and authorities in DHIS2?
Thank you!
Hi @Gassim
sorry for the late response, the version we are using is 2.35.8, I tried creating roles with different authorities but I didnât seem to see those authorities.
Thanks!
Hey,
I think there is an authority that shouldnât be granted to the role that the user is assigned but Iâm not 100% sure:
Hey,
You are right, that authority can grant Delete TEI and associated enrollments and events, but the delete I want to hide (get rid of) is the one on the enrollment form, because they mistakenly use that button which doesnât delete everything and causes later, to not be able to recreate or search it.
Thanks @duserik! Would you like to create a feature request for this?
A workaround that I think for you is to use custom JavaScript/CSS but Iâve not been able to successfully apply that.
@duserik hereâs another idea that I just read from @markus:
There is a way to hide or collapse the entire widget for enrollment, so you can try it and consider whether that would be OK to directing the users away from the button.
You can change the widget layout and store your layout as default for all users.
When a user does not have the depicted authority and the âDelete enrollmentâŚâ authority listed below it, they are not allowed to directly delete an enrollment that contains any events.
Markus
@duserik so that should work, donât give them the âdelete enrollmentâ authority and they wonât be able to misuse that button, right? (: Thanks!
I checked the role given to those users who did that, donât have those authorities ticked but still they can delete an enrollment; unless it is a bug in version 2.35.
Would you be able to reproduce this on play.dhis2.org? I just tried to reproduce it on https://play.dhis2.org/2.35nightly and I wasnât able to delete an enrollment.
To be 100% sure Iâd say create a new user and only grant this user the authorities to access the Dashboard and Tracker Capture app as well as the other required authorities (except for the authority to delete an enrollment or an entity.) Additionally, assign all necessary org units and change the program sharing settings to view and edit for this user. Login to this userâs account using your browserâs incognito mode and if you are still able to delete the enrollment then it is a bug.
Thanks!