From 944780f74b405507565ccd2c65b3ca5b90098c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 14 Feb 2019 15:23:20 +0100 Subject: [PATCH] Only allow deletion for undeleted boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/BoardService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index d8997817a..dd11ad3e4 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -307,6 +307,9 @@ class BoardService { $this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_READ); $board = $this->find($id); + if ($board->getDeletedAt() > 0) { + throw new BadRequestException('This board has already been deleted'); + } $board->setDeletedAt(time()); $board = $this->boardMapper->update($board); $this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_BOARD, $board, ActivityManager::SUBJECT_BOARD_DELETE);