diff --git a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php index b414ec1cec3a94c6dd528a04b82df47e64a0a6b8..efed92c2e7efeedf214b12c6851ed766f7528da8 100644 --- a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php +++ b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php @@ -366,10 +366,11 @@ class PageProvider extends RecordProvider * * @return bool */ - protected function canBeRemoved(): bool + protected function canBeDeleted(): bool { return !$this->isDeletePlaceholder() && !$this->isRecordLocked() + && !$this->isDeletionDisabledInTS() && $this->hasPagePermission(Permission::PAGE_DELETE); } diff --git a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php index 94b441671d2f4056af83e106753af66acd4e0593..1d15c5ba812f50dd35cebc61cd797b2471ca54ce 100644 --- a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php +++ b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php @@ -486,15 +486,25 @@ class RecordProvider extends AbstractProvider } /** - * Checks if the user has the right to delete the page + * Checks if disableDelete flag is set in TSConfig for the current table * * @return bool */ - protected function canBeDeleted(): bool + protected function isDeletionDisabledInTS(): bool { $disableDeleteTS = $this->backendUser->getTSConfig('options.disableDelete'); $disableDelete = (bool) trim($disableDeleteTS['properties'][$this->table] ?? (string)$disableDeleteTS['value']); - return !$disableDelete && $this->canBeEdited(); + return $disableDelete; + } + + /** + * Checks if the user has the right to delete the page + * + * @return bool + */ + protected function canBeDeleted(): bool + { + return !$this->isDeletionDisabledInTS() && $this->canBeEdited(); } /**