I started implementing the user access control system in the location mapping UI.
Issue Link | Draft PR Link
There are 2 privileges related to Location Mapping UI.
- View Location Mappings
- Manage Location Mappings
I used <openmrs:require >
tag and <onpenmrs:hasPrivilege>
tag to load content according to the privileges.
This is how the UI will work after adding the module privileges.
-
Users with
Manage Location Mappings
privilege (or both privileges) can edit or update mappings -
Users with
View Location Mappings
privilege can only see the mappings -
Users who don’t have any of these 2 privileges can’t see the page or the link in the navbar.
Will be redirected to the login page if the user try to access by using the URL
cc: @jayasanka @akshika47