class DocumentsController {

    @PreAuthorize("hasPermission(#projectId, 'org.innovateuk.ifs.project.resource.ProjectCompositeId', 'EDIT_DOCUMENTS_SECTION')")
    @PostMapping(value = "/config/{documentConfigId}", params = "deleteDocument")
    public String deleteDocument(@PathVariable("projectId") long projectId,
                                 @PathVariable("documentConfigId") long documentConfigId,
                                 @ModelAttribute(FORM_ATTR) DocumentForm form,
                                 @SuppressWarnings("unused") BindingResult bindingResult,
                                 ValidationHandler validationHandler,
                                 Model model,
                                 UserResource loggedInUser) {

        return performActionOrBindErrorsToField(projectId, documentConfigId, validationHandler, model, loggedInUser, "document", form,
                () -> documentsRestService.deleteDocument(projectId, documentConfigId));
    }

    public  DocumentsController();
    @Autowired public  DocumentsController(DocumentsPopulator populator, DocumentsRestService documentsRestService);

}