diff --git a/omod/src/main/java/org/openmrs/module/spa/SpaDirectoryResolver.java b/omod/src/main/java/org/openmrs/module/spa/SpaDirectoryResolver.java index 4883625..6a3ab3c 100644 --- a/omod/src/main/java/org/openmrs/module/spa/SpaDirectoryResolver.java +++ b/omod/src/main/java/org/openmrs/module/spa/SpaDirectoryResolver.java @@ -5,6 +5,7 @@ import org.openmrs.api.GlobalPropertyListener; import org.openmrs.api.context.Context; import org.openmrs.util.OpenmrsUtil; +import org.openmrs.util.PrivilegeConstants; import java.nio.file.Path; import java.nio.file.Paths; @@ -46,7 +47,13 @@ public static String getSpaDirectory() { } private String getDirectoryFromSettings() { - String localDirectory = Context.getAdministrationService().getGlobalProperty(GP_LOCAL_DIRECTORY); + String localDirectory; + try { + Context.addProxyPrivilege(PrivilegeConstants.GET_GLOBAL_PROPERTIES); + localDirectory = Context.getAdministrationService().getGlobalProperty(GP_LOCAL_DIRECTORY); + } finally { + Context.removeProxyPrivilege(PrivilegeConstants.GET_GLOBAL_PROPERTIES); + } if (localDirectory == null) { localDirectory = Context.getRuntimeProperties().getProperty(GP_LOCAL_DIRECTORY);