ModelService model;
try {
model = dispatcher.getDispatchContext().getModelService(xmlRpcReq.getMethodName());
} catch (GenericServiceException e) {
throw new XmlRpcException(e.getMessage(), e);
}
if (model != null && model.auth) {
String username = config.getBasicUserName();
String password = config.getBasicPassword();
// check the account
Map<String, Object> context = FastMap.newInstance();
context.put("login.username", username);
context.put("login.password", password);
Map<String, Object> resp;
try {
resp = dispatcher.runSync("userLogin", context);
} catch (GenericServiceException e) {
throw new XmlRpcException(e.getMessage(), e);
}
if (ServiceUtil.isError(resp)) {
return false;
}