public class ReportsDwr extends ModuleDwr {
@DwrPermission(user = true)
public ProcessResult init() {
ProcessResult response = new ProcessResult();
ReportDao reportDao = new ReportDao();
User user = Common.getUser();
response.addData("points", getReadablePoints());
response.addData("mailingLists", new MailingListDao().getMailingLists());
response.addData("users", new UserDao().getUsers());
if(user.isAdmin()) {
response.addData("reports", reportDao.getReports());
response.addData("instances", getReportInstances(user));
}
else {
response.addData("reports", reportDao.getReports(user.getId()));
response.addData("instances", getReportInstances(user));
}
response.addData("templates", getTemplateList());
return response;