diff --git a/src/Controller/Admin/Document/DeleteController.php b/src/Controller/Admin/Document/DeleteController.php new file mode 100644 index 0000000..d404452 --- /dev/null +++ b/src/Controller/Admin/Document/DeleteController.php @@ -0,0 +1,37 @@ +entityManager->remove($document); + $this->entityManager->flush(); + + $this->addFlash('success', 'Das Dokument wurde gelöscht'); + $this->logger->info('Delete document', [ + 'document_filename' => $document->getOriginalFilename(), + 'owner' => $document->getOwner()->getFullName(), + ]); + + return $this->redirectToRoute('app_admin_document_index'); + } +} \ No newline at end of file diff --git a/templates/admin/document/index.html.twig b/templates/admin/document/index.html.twig index cc3cd10..da25f3e 100644 --- a/templates/admin/document/index.html.twig +++ b/templates/admin/document/index.html.twig @@ -66,6 +66,18 @@
+ {% if is_granted('DELETE', upload) %} + + {% endif %} {% if is_granted('CHECK', upload) %}