当前位置: 首页>>代码示例>>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;未经允许,请勿转载。