}
class OfbizRpcAuthHandler implements AbstractReflectiveHandlerMapping.AuthenticationHandler {
public boolean isAuthorized(XmlRpcRequest xmlRpcReq) throws XmlRpcException {
XmlRpcHttpRequestConfig config = (XmlRpcHttpRequestConfig) xmlRpcReq.getConfig();
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);