本文整理汇总了PHP中TYPO3\CMS\Core\Authentication\BackendUserAuthentication::workspaceCannotEditRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUserAuthentication::workspaceCannotEditRecord方法的具体用法?PHP BackendUserAuthentication::workspaceCannotEditRecord怎么用?PHP BackendUserAuthentication::workspaceCannotEditRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Authentication\BackendUserAuthentication
的用法示例。
在下文中一共展示了BackendUserAuthentication::workspaceCannotEditRecord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_datamap
//.........这里部分代码省略.........
// Yes new record, change $record_status to 'insert'
$status = 'new';
} else {
// Nope... $id is a number
$fieldArray = array();
$recordAccess = $this->checkRecordUpdateAccess($table, $id, $incomingFieldArray, $hookObjectsArr);
if (!$recordAccess) {
if ($this->enableLogging) {
$propArr = $this->getRecordProperties($table, $id);
$this->log($table, $id, 2, 0, 1, 'Attempt to modify record \'%s\' (%s) without permission. Or non-existing page.', 2, array($propArr['header'], $table . ':' . $id), $propArr['event_pid']);
}
continue;
}
// Next check of the record permissions (internals)
$recordAccess = $this->BE_USER->recordEditAccessInternals($table, $id);
if (!$recordAccess) {
if ($this->enableLogging) {
$this->newlog('recordEditAccessInternals() check failed. [' . $this->BE_USER->errorMsg . ']', 1);
}
} else {
// Here we fetch the PID of the record that we point to...
$tempdata = $this->recordInfo($table, $id, 'pid' . ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ? ',t3ver_wsid,t3ver_stage' : ''));
$theRealPid = $tempdata['pid'];
// Use the new id of the versionized record we're trying to write to:
// (This record is a child record of a parent and has already been versionized.)
if ($this->autoVersionIdMap[$table][$id]) {
// For the reason that creating a new version of this record, automatically
// created related child records (e.g. "IRRE"), update the accordant field:
$this->getVersionizedIncomingFieldArray($table, $id, $incomingFieldArray, $registerDBList);
// Use the new id of the copied/versionized record:
$id = $this->autoVersionIdMap[$table][$id];
$recordAccess = true;
$this->autoVersioningUpdate = true;
} elseif (!$this->bypassWorkspaceRestrictions && ($errorCode = $this->BE_USER->workspaceCannotEditRecord($table, $tempdata))) {
$recordAccess = false;
// Versioning is required and it must be offline version!
// Check if there already is a workspace version
$WSversion = BackendUtility::getWorkspaceVersionOfRecord($this->BE_USER->workspace, $table, $id, 'uid,t3ver_oid');
if ($WSversion) {
$id = $WSversion['uid'];
$recordAccess = true;
} elseif ($this->BE_USER->workspaceAllowAutoCreation($table, $id, $theRealPid)) {
// new version of a record created in a workspace - so always refresh pagetree to indicate there is a change in the workspace
$this->pagetreeNeedsRefresh = true;
/** @var $tce DataHandler */
$tce = GeneralUtility::makeInstance(__CLASS__);
$tce->stripslashes_values = false;
// Setting up command for creating a new version of the record:
$cmd = array();
$cmd[$table][$id]['version'] = array('action' => 'new', 'treeLevels' => -1, 'label' => 'Auto-created for WS #' . $this->BE_USER->workspace);
$tce->start(array(), $cmd);
$tce->process_cmdmap();
$this->errorLog = array_merge($this->errorLog, $tce->errorLog);
// If copying was successful, share the new uids (also of related children):
if ($tce->copyMappingArray[$table][$id]) {
foreach ($tce->copyMappingArray as $origTable => $origIdArray) {
foreach ($origIdArray as $origId => $newId) {
$this->uploadedFileArray[$origTable][$newId] = $this->uploadedFileArray[$origTable][$origId];
$this->autoVersionIdMap[$origTable][$origId] = $newId;
}
}
ArrayUtility::mergeRecursiveWithOverrule($this->RTEmagic_copyIndex, $tce->RTEmagic_copyIndex);
// See where RTEmagic_copyIndex is used inside fillInFieldArray() for more information...
// Update registerDBList, that holds the copied relations to child records:
$registerDBList = array_merge($registerDBList, $tce->registerDBList);
// For the reason that creating a new version of this record, automatically