hasRoleOperation = checkHasRoleOperations(partyId, targetOperationList, delegator);
}
if (hasRoleOperation) {
return true;
}
ModelEntity modelEntity = delegator.getModelEntity(entityName);
boolean hasStatusField = false;
if (modelEntity.getField("statusId") != null)
hasStatusField = true;
boolean hasPrivilegeField = false;
if (modelEntity.getField("privilegeEnumId") != null)
hasPrivilegeField = true;
ModelEntity modelOperationEntity = delegator.getModelEntity(entityName + "PurposeOperation");
if (modelOperationEntity == null) {
modelOperationEntity = delegator.getModelEntity(entityName + "Operation");
}
if (modelOperationEntity == null) {
Debug.logError("No operation entity found for " + entityName, module);
throw new RuntimeException("No operation entity found for " + entityName);
}
boolean hasPurposeOp = false;
if (modelOperationEntity.getField(lcEntityName + "PurposeTypeId") != null)
hasPurposeOp = true;
boolean hasStatusOp = false;
if (modelOperationEntity.getField("statusId") != null)
hasStatusOp = true;
boolean hasPrivilegeOp = false;
if (modelOperationEntity.getField("privilegeEnumId") != null)
hasPrivilegeOp = true;
// Get all the condition operations that could apply, rather than having to go thru
// entire table each time.
//List condList = FastList.newInstance();
//Iterator iterType = targetOperationList.iterator();
//while (iterType.hasNext()) {
// String op = (String)iterType.next();
// condList.add(EntityCondition.makeCondition(lcEntityName + "OperationId", op));
//}
//EntityCondition opCond = EntityCondition.makeCondition(condList, EntityOperator.OR);
EntityCondition opCond = EntityCondition.makeCondition(lcEntityName + "OperationId", EntityOperator.IN, targetOperationList);
List<GenericValue> targetOperationEntityList = delegator.findList(modelOperationEntity.getEntityName(), opCond, null, null, null, true);
Map<String, GenericValue> entities = FastMap.newInstance();
String pkFieldName = modelEntity.getFirstPkFieldName();
//TODO: privilegeEnumId test
/*