@Override public Map<String, String> getLinks(String page, Object object) { Map<String, String> map = null; if (page.equals("viewOrganization.jsp")) { if (!(object instanceof Unit)) { return null; } Unit unit = (Unit) object; final User user = UserView.getCurrentUser(); Person currentUser = user.getExpenditurePerson(); if (!(unit.isResponsible(currentUser) || unit.getObserversSet().contains(currentUser) || UserView.getCurrentUser().hasRoleType(RoleType.MANAGER) || unit.isProjectAccountingEmployee(currentUser) || ExpenditureTrackingSystem.isProjectAccountingManagerGroupMember(user) || ExpenditureTrackingSystem.isAcquisitionsProcessAuditorGroupMember(user))) { return null; } map = new HashMap<String, String>(); String baseLink = "/vaadinContext.do?method=forwardToVaadin#projectsService?unit=" + unit.getExternalId(); if (unit.isProject()) { map.put( getMessage("financialprojectsreports.infoProvider.cabimentos"), baseLink + "&reportType=" + ReportType.CABIMENTOS_STRING); map.put( getMessage("financialprojectsreports.infoProvider.adiantamentos"), baseLink + "&reportType=" + ReportType.ADIANTAMENTOS_STRING); map.put( getMessage("financialprojectsreports.infoProvider.revenue"), baseLink + "&reportType=" + ReportType.REVENUE_STRING); map.put( getMessage("financialprojectsreports.infoProvider.expenses"), baseLink + "&reportType=" + ReportType.EXPENSES_STRING); map.put( getMessage("financialprojectsreports.infoProvider.budgetaryBalance"), baseLink + "&reportType=" + ReportType.PROJECT_BUDGETARY_BALANCE_STRING); map.put( getMessage("financialprojectsreports.infoProvider.openingFile"), baseLink + "&reportType=" + ReportType.OPENING_PROJECT_FILE_STRING); } else { map.put( getMessage("financialprojectsreports.infoProvider.unitSummary"), baseLink + "&reportType=" + ReportType.UNIT_SUMMARY_STRING); map.put( getMessage("financialprojectsreports.infoProvider.generatedOverheads"), baseLink + "&reportType=" + ReportType.GENERATED_OVERHEADS_STRING); map.put( getMessage("financialprojectsreports.infoProvider.transferedOverheads"), baseLink + "&reportType=" + ReportType.TRANSFERED_OVERHEADS_STRING); map.put( getMessage("financialprojectsreports.infoProvider.overheadsSummary"), baseLink + "&reportType=" + ReportType.OVERHEADS_SUMMARY_STRING); } } if (page.equals("viewPerson.jsp")) { if (!(object instanceof Person)) { return null; } Person person = (Person) object; if (!(UserView.getCurrentUser().getExpenditurePerson().equals(person) || UserView.getCurrentUser().hasRoleType(RoleType.MANAGER))) { return null; } map = new HashMap<String, String>(); map.put( getMessage("financialprojectsreports.infoProvider.coordinatorSummary"), "/vaadinContext.do?method=forwardToVaadin#projectsService?reportType=" + ReportType.SUMMARY_STRING + "&user=" + person.getUsername()); } return map; }