class ProjectFinanceChecksController {

    @PreAuthorize("hasPermission(#projectId, 'org.innovateuk.ifs.project.resource.ProjectCompositeId', 'ACCESS_FINANCE_CHECKS_SECTION_EXTERNAL')")
    @GetMapping("/eligibility")
    public String viewExternalEligibilityPage(@PathVariable final long projectId,
                                              Model model,
                                              UserResource loggedInUser) {
        ProjectResource project = projectService.getById(projectId);
        Long organisationId = projectService.getOrganisationIdFromUser(projectId, loggedInUser);
        ApplicationResource application = applicationService.getById(project.getApplication());
        OrganisationResource organisation = organisationRestService.getOrganisationById(organisationId).getSuccess();
        OrganisationResource leadOrganisation = projectService.getLeadOrganisation(projectId);
        boolean isLeadPartnerOrganisation = leadOrganisation.getId().equals(organisation.getId());

        return doViewEligibility(application, project, isLeadPartnerOrganisation, organisation, model);
    }

}