Skip to content

Commit

Permalink
use canDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Apr 20, 2021
1 parent 3a4af98 commit 46adefc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/SoftDeletable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 46adefc

Please sign in to comment.