當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BackendUserAuthentication::workspaceAllowLiveRecordsInPID方法代碼示例

本文整理匯總了PHP中TYPO3\CMS\Core\Authentication\BackendUserAuthentication::workspaceAllowLiveRecordsInPID方法的典型用法代碼示例。如果您正苦於以下問題:PHP BackendUserAuthentication::workspaceAllowLiveRecordsInPID方法的具體用法?PHP BackendUserAuthentication::workspaceAllowLiveRecordsInPID怎麽用?PHP BackendUserAuthentication::workspaceAllowLiveRecordsInPID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TYPO3\CMS\Core\Authentication\BackendUserAuthentication的用法示例。


在下文中一共展示了BackendUserAuthentication::workspaceAllowLiveRecordsInPID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: process_datamap


//.........這裏部分代碼省略.........
                             // The numerical pid is inserted in the data array
                             $fieldArray['pid'] = $pid_value;
                         } else {
                             // points to another record before ifself
                             // If this table is sorted we better find the top sorting number
                             if ($sortRow) {
                                 // Because $pid_value is < 0, getSortNumber returns an array
                                 $tempArray = $this->getSortNumber($table, 0, $pid_value);
                                 $fieldArray['pid'] = $tempArray['pid'];
                                 $fieldArray[$sortRow] = $tempArray['sortNumber'];
                             } else {
                                 // Here we fetch the PID of the record that we point to...
                                 $tempdata = $this->recordInfo($table, abs($pid_value), 'pid');
                                 $fieldArray['pid'] = $tempdata['pid'];
                             }
                         }
                     }
                 }
                 $theRealPid = $fieldArray['pid'];
                 // Now, check if we may insert records on this pid.
                 if ($theRealPid >= 0) {
                     // Checks if records can be inserted on this $pid.
                     $recordAccess = $this->checkRecordInsertAccess($table, $theRealPid);
                     if ($recordAccess) {
                         $this->addDefaultPermittedLanguageIfNotSet($table, $incomingFieldArray);
                         $recordAccess = $this->BE_USER->recordEditAccessInternals($table, $incomingFieldArray, true);
                         if (!$recordAccess) {
                             if ($this->enableLogging) {
                                 $this->newlog('recordEditAccessInternals() check failed. [' . $this->BE_USER->errorMsg . ']', 1);
                             }
                         } elseif (!$this->bypassWorkspaceRestrictions) {
                             // Workspace related processing:
                             // If LIVE records cannot be created in the current PID due to workspace restrictions, prepare creation of placeholder-record
                             if ($res = $this->BE_USER->workspaceAllowLiveRecordsInPID($theRealPid, $table)) {
                                 if ($res < 0) {
                                     $recordAccess = false;
                                     if ($this->enableLogging) {
                                         $this->newlog('Stage for versioning root point and users access level did not allow for editing', 1);
                                     }
                                 }
                             } else {
                                 // So, if no live records were allowed, we have to create a new version of this record:
                                 if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
                                     $createNewVersion = true;
                                 } else {
                                     $recordAccess = false;
                                     if ($this->enableLogging) {
                                         $this->newlog('Record could not be created in this workspace in this branch', 1);
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     debug('Internal ERROR: pid should not be less than zero!');
                 }
                 // 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']);
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:67,代碼來源:DataHandler.php


注:本文中的TYPO3\CMS\Core\Authentication\BackendUserAuthentication::workspaceAllowLiveRecordsInPID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。