Skip to content

Commit

Permalink
ADDR-132: Add 'Get Global Properties' proxy privilege
Browse files Browse the repository at this point in the history
  • Loading branch information
Seremba committed Feb 29, 2024
1 parent 8299adb commit ca8ffc2
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,21 +703,24 @@ else if (level.getParent() == null){

@Transactional(readOnly = true)
synchronized public void initializeFullAddressCache() {

// generally, this global property should be set to true; it just allows cache load to be disabled to speed startup
if (Context.getAdministrationService().getGlobalProperty(AddressHierarchyConstants.GLOBAL_PROP_INITIALIZE_ADDRESS_HIERARCHY_CACHE_ON_STARTUP).equalsIgnoreCase("true")) {


Context.addProxyPrivilege("Get Global Properties");
if (Context.getAdministrationService()
.getGlobalProperty(AddressHierarchyConstants.GLOBAL_PROP_INITIALIZE_ADDRESS_HIERARCHY_CACHE_ON_STARTUP)
.equalsIgnoreCase("true")) {

// only initialize if necessary (and if we have entries)
if ((this.fullAddressCacheInitialized == false || MapUtils.isEmpty(this.fullAddressCache))
&& this.getAddressHierarchyEntryCount() > 0) {

this.fullAddressCache = new HashMap<Locale, Map<String,List<String>> >();
&& this.getAddressHierarchyEntryCount() > 0) {
this.fullAddressCache = new HashMap<Locale, Map<String, List<String>>>();
Locale locale = i18nCache.getLocaleForFullAddressCache();
getAddressesForLocale(locale);
this.fullAddressCacheInitialized = true;
}
}

}

private synchronized Map<String,List<String>> getAddressesForLocale(Locale locale) {
Expand Down

0 comments on commit ca8ffc2

Please sign in to comment.