PanelSecurity.PanelSecurityEntry entry = (PanelSecurity.PanelSecurityEntry) it.next();
checkMethodSecurity(entry.getMethodName(), entry.getPermissionClass(), entry.getAction(), panel);
}
}
// Invoke the panel's action method.
CommandResponse res = null;
if (!isSystemAction(action)) res = fireBeforeInvokeAction(panel, req);
if (res == null) res = (CommandResponse) method.invoke(this, args);
if (!isSystemAction(action)) res = fireAfterInvokeAction(panel, req, res);
// If no AJAX then return the response get from panel invocation.
String ajaxParam = req.getParameter(Parameters.AJAX_ACTION);
if (ajaxParam == null || !Boolean.valueOf(ajaxParam).booleanValue()) return res;
// Despite the request was AJAX the panel has decided refreshing the full screen.
if (res != null && res.getClass().equals(ShowCurrentScreenResponse.class)) return res;
// Else return the response wrapped as AJAX.
PanelAjaxResponse response = PanelAjaxResponse.getEquivalentAjaxResponse(panel, res);
if (response == null) log.error("Cannot convert response with " + res.getClass() + " to PanelAjaxResponse.");
return response;
}