Skip to content

Commit

Permalink
TRUNK-6203: Global properties access should be privileged
Browse files Browse the repository at this point in the history
  • Loading branch information
wikumChamith committed Jul 30, 2024
1 parent b565ccf commit 24fc2d6
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,15 @@ else if (level.getParent() == null){
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")) {
String globalProperty = "";
try {
Context.addProxyPrivilege("GET GLOBAL PROPERTIES");
globalProperty = Context.getAdministrationService().getGlobalProperty(AddressHierarchyConstants.GLOBAL_PROP_INITIALIZE_ADDRESS_HIERARCHY_CACHE_ON_STARTUP);
} finally {
Context.removeProxyPrivilege("GET GLOBAL PROPERTIES");
}

if (globalProperty.equalsIgnoreCase("true")) {

// only initialize if necessary (and if we have entries)
if ((this.fullAddressCacheInitialized == false || MapUtils.isEmpty(this.fullAddressCache))
Expand Down

0 comments on commit 24fc2d6

Please sign in to comment.