class ManageInvitationsController {

    @SecuredBySpring(value = "MANAGE_INVITATIONS", description = "Only project finance users can manage invitations")
    @PreAuthorize("hasAnyAuthority('project_finance')")
    @PostMapping(params = "resend-invite")
    public String resendInvitation(Model model, @RequestParam("resend-invite") long inviteId, @PathVariable long projectId, @ModelAttribute("form") InvitationForm form,
                                   BindingResult bindingResult, ValidationHandler validationHandler, HttpServletResponse response) {

        Supplier<String> failureView = () -> viewInvitations(model, projectId, form);
        Supplier<String> successView = () -> {
            cookieFlashMessageFilter.setFlashMessage(response, "emailSent");
            return String.format("redirect:/project/%d/grants/invite", projectId);
        };

        validationHandler.addAnyErrors(grantsInviteRestService.resendInvite(projectId, inviteId));
        return validationHandler.failNowOrSucceedWith(failureView, successView);
    }

}