From 46adefc7d2de39f628d0a4e40165768a9cf289b6 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 20 Apr 2021 17:24:05 +0200 Subject: [PATCH] use canDelete --- code/SoftDeletable.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/SoftDeletable.php b/code/SoftDeletable.php index 883565f..fc71313 100644 --- a/code/SoftDeletable.php +++ b/code/SoftDeletable.php @@ -144,6 +144,11 @@ public function updateCMSActions(FieldList $actions) } } + // Use canDelete + if (!$this->owner->canDelete()) { + return; + } + if ($this->owner->Deleted) { $undoDelete = new CustomAction('undoDelete', 'Undo Delete'); $actions->push($undoDelete);