Project

General

Profile

Actions

Bug #76215

closed

DataHandler | bypassAccessCheckForRecords flag gets lost

Added by Andreas Stenger over 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2016-05-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The following code inside a backend-module fails due to access restrictions.

private function clonePages($copyPid, $targetPid)
{
    $cmdmap['pages'][$copyPid]['copy'] = $targetPid;

    $this->tce->copyTree = 99;

    $this->tce->bypassAccessCheckForRecords = true;
    $this->tce->start(false, $cmdmap);
    $this->tce->process_cmdmap();

    return $this->tce->copyMappingArray_merged;
}

Goal:
Copy the page-tree of $copyPid recursive as new child-tree of $targetPid.

Issue:
The current backend-user does not have access (no db-mount) to the page $copyPid nor to the page $targetPid.
By setting $this->tce->bypassAccessCheckForRecords = true; however the access-check for $copyPid gets skipped, as intended.
For the access-check of $targetPid the flag is false for some reason what results in "Attempt to insert a record on page '###' (###) from table 'pages' without permissions. Or non-existing page."
I dont see a way to keep the flag set to true allthough in this case i need both checks to be skipped.

This can be checked by e.g. var_dumping $this->bypassAccessCheckForRecords in TYPO3\CMS\Core\DataHandling\DataHandler::doesRecordExist

Actions #1

Updated by Susanne Moog almost 7 years ago

  • Category set to DataHandler aka TCEmain
Actions #2

Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62931

Actions #3

Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62972

Actions #4

Updated by Benni Mack almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF