medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
438 stars 209 forks source link

Add permission to allow or block editing contacts in webapp #8867

Open dianabarsan opened 7 months ago

dianabarsan commented 7 months ago

What feature do you want to improve? There is no way to block showing the edit button on contact detail pages, apart from blocking all writes by removing the can_edit permission.

https://github.com/medic/cht-core/blob/91c9349205324af36106749fe6d60042dbceb8f0/webapp/src/ts/components/actionbar/actionbar.component.html#L247

For reports, we have a specific permission can_update_reports that gets checked along with can_edit in webapp actionbar.

https://github.com/medic/cht-core/blob/91c9349205324af36106749fe6d60042dbceb8f0/webapp/src/ts/components/actionbar/actionbar.component.html#L149

Describe the improvement you'd like Add a can_edit_contacts permission, to mirror can_update_reports.

Describe alternatives you've considered We could fine-tune this and somehow check individually for each contact, possibly by adding permissions to contact edit forms?

Additional context Forum request

latin-panda commented 1 month ago

The action bar has been removed as part of this work.

The verify report action is now located in the more options menu of the Reports module