/** * method will filter any items that don't pass security checks WDEV-11071,WDEV-11109 */ public ComponentSelectOrderVoCollection getChildComponentsForOrderSet(Integer orderSetID, RoleDisciplineSecurityLevelLiteGCVo voSecurity) { ComponentSelectOrderVoCollection components = OrderSetSelectOrderVoAssembler.create((OrderSet)getDomainFactory().getDomainObject(OrderSet.class, orderSetID.intValue())).getComponents(); //enforce Security here ComponentSelectOrderVoCollection removableComponenets = new ComponentSelectOrderVoCollection(); for(ComponentSelectOrderVo comp : components) { if(comp.getInvestigationIsNotNull()) { if(voSecurity != null) { SecurityLevelAndServiceCheckVo voSecLevelAndService = getSecurityLevelAndServiceForInvestigation(comp.getInvestigation().getInvestigationIndex().getID_InvestigationIndex()); if(voSecLevelAndService != null && voSecLevelAndService.getSecurityLevelIsNotNull() && voSecLevelAndService.getServiceIsNotNull()) { if(!voSecurity.doesInvPassSecurityCheck(voSecLevelAndService.getService(),voSecLevelAndService.getSecurityLevel(),true)) //WDEV-11622 { removableComponenets.add(comp); continue; } } } } } if(removableComponenets.size() > 0) { for(ComponentSelectOrderVo compToRemove : removableComponenets) { components.remove(compToRemove); } } return components; }