for(Node templateNode : templateNodeList){
String templateIdStr = XMLUtil.getAttribute(templateNode, "id");
UUID templateId = DataAccessFactory.getInstance().createUUID(templateIdStr);
if (allTemplateMap.get(templateId) == null) {
Template tmp = das.queryTemplate(templateId);
allTemplateMap.put(templateId, tmp);
}
Template template = allTemplateMap.get(templateId);
if(template != null){
templateList.add(template);
}
}
}
boolean filterAllow = false;
for(Template template : templateList){
if(templateAllowMap.containsKey(template.getId())){
if(templateAllowMap.get(template.getId())){
filterAllow = true;
break;
}
continue;
}
if (allFlowMap.get(template.getFlowId()) == null) {
Flow tmp = das.queryFlow(template.getFlowId());
allFlowMap.put(template.getFlowId(), tmp);
}
Flow flow = allFlowMap.get(template.getFlowId());
if(flow == null){
templateAllowMap.put(template.getId(), false);
continue;
}
Role[] roleArray = flow.queryUserNodeRoles(user, template.getId());
if(roleArray != null && roleArray.length > 0){
filterAllow = true;
templateAllowMap.put(template.getId(), true);
break;
}
if(flow.isActionEveryoneRole(Action.readUUID) || flow.isActionEveryoneRole(Action.editUUID)){
filterAllow = true;
templateAllowMap.put(template.getId(), true);
break;
}
Action[] actionArray = flow.getActions();
if(actionArray != null){
for(Action action : actionArray){
if(flow.isActionEveryoneRole(action.getId())){
filterAllow = true;
templateAllowMap.put(template.getId(), true);
break;
}
}
}
if(filterAllow){
break;
}
templateAllowMap.put(template.getId(), false);
}
if(!filterAllow)
filterItr.remove();
}