diff --git a/omod/src/main/java/org/openmrs/module/referenceapplication/page/controller/LoginPageController.java b/omod/src/main/java/org/openmrs/module/referenceapplication/page/controller/LoginPageController.java index f5ae2a4..7f535f9 100644 --- a/omod/src/main/java/org/openmrs/module/referenceapplication/page/controller/LoginPageController.java +++ b/omod/src/main/java/org/openmrs/module/referenceapplication/page/controller/LoginPageController.java @@ -33,6 +33,7 @@ import org.openmrs.ui.framework.annotation.SpringBean; import org.openmrs.ui.framework.page.PageModel; import org.openmrs.ui.framework.page.PageRequest; +import org.openmrs.util.PrivilegeConstants; import org.openmrs.web.user.CurrentUsers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.CookieValue; @@ -150,9 +151,14 @@ public String get(PageModel model, UiUtils ui, PageRequest pageRequest, } private boolean isLocationUserPropertyAvailable(AdministrationService administrationService) { - String locationUserPropertyName = administrationService - .getGlobalProperty(ReferenceApplicationConstants.LOCATION_USER_PROPERTY_NAME); - + String locationUserPropertyName; + try { + Context.addProxyPrivilege(PrivilegeConstants.GET_GLOBAL_PROPERTIES); + locationUserPropertyName = administrationService + .getGlobalProperty(ReferenceApplicationConstants.LOCATION_USER_PROPERTY_NAME); + } finally { + Context.removeProxyPrivilege(PrivilegeConstants.GET_GLOBAL_PROPERTIES); + } return StringUtils.isNotBlank(locationUserPropertyName); }