/** * Checks whether the current backend user has access to the given records. * * @param string $table: Name of the table * @param array $rows: Record row * @return void */ protected function checkRecordAccess($table, array $rows) { foreach ($rows as $key => $row) { if (\TYPO3\CMS\Recycler\Utility\RecyclerUtility::checkAccess($table, $row)) { $this->setDeletedRows($table, $row); } } }
/** * Checks whether the current backend user has access to the given records. * * @param string $table Name of the table * @param array $rows Record row * @return void */ protected function checkRecordAccess($table, array $rows) { if ($table === 'pages') { // The "checkAccess" method validates access to the passed table/rows. When access to // a page record gets validated it is necessary to disable the "delete" field temporarily // for the recycler. // Else it wouldn't be possible to perform the check as many methods of BackendUtility // like "BEgetRootLine", etc. will only work on non-deleted records. $deleteField = $GLOBALS['TCA'][$table]['ctrl']['delete']; unset($GLOBALS['TCA'][$table]['ctrl']['delete']); } foreach ($rows as $row) { if (RecyclerUtility::checkAccess($table, $row)) { $this->setDeletedRows($table, $row); } } if ($table === 'pages') { $GLOBALS['TCA'][$table]['ctrl']['delete'] = $deleteField; } }