fixed var name

This commit is contained in:
Luca Frosini 2024-10-29 14:38:58 +01:00
parent 3ec9670319
commit 281285761f
1 changed files with 8 additions and 3 deletions

View File

@ -62,13 +62,17 @@ public abstract class HierarchicalSystemEnvironment extends SystemEnvironment {
this.hierarchicPoolMap = new HashMap<>();
boolean hierarchicalModeRequested = RequestUtility.getRequestInfo().get().isHierarchicalMode();
logger.trace("HierarchicalMode {}requested", hierarchicalModeRequested ? "" : "not ");
boolean hierarchicalAllowed = isUserAllowed(SystemEnvironment.getAllOperationsAllowedRoles());
logger.trace("{} is {}to request the ", ContextUtility.getCurrentUserUsername(), hierarchicalAllowed ? "" : "not ");
/*
* Only the Infrastructure Manager and IS Manager are entitled to use hierarchical mode.
* I decided not to complain if the user does not have such roles and assumed the hierarchical mode was not requested.
*/
if(!hierarchicalAllowed) {
if(hierarchicalModeRequested && !hierarchicalAllowed) {
StringBuffer sb = new StringBuffer();
sb.append("The user ");
sb.append(ContextUtility.getCurrentUserUsername());
@ -77,14 +81,15 @@ public abstract class HierarchicalSystemEnvironment extends SystemEnvironment {
sb.append(". Instead of complaining, the request will be elaborated not in hierarchical mode.");
logger.warn(sb.toString());
}
this.hierarchical = hierarchicalAllowed;
this.hierarchical = hierarchicalAllowed && hierarchicalModeRequested;
this.children = new HashSet<>();
}
protected boolean isHierarchicalMode() {
return hierarchical || RequestUtility.getRequestInfo().get().isHierarchicalMode();
return hierarchical;
}
public void setParentEnvironment(HierarchicalSystemEnvironment parentEnvironment) {