Index: t3lib/class.t3lib_tcemain.php =================================================================== --- t3lib/class.t3lib_tcemain.php (revision 7167) +++ t3lib/class.t3lib_tcemain.php (working copy) @@ -757,7 +757,7 @@ $status = 'new'; // Yes new record, change $record_status to 'insert' } else { // Nope... $id is a number $fieldArray = array(); - $recordAccess = $this->checkRecordUpdateAccess($table,$id); + $recordAccess = $this->checkRecordUpdateAccess($table, $id, $data, $hookObjectsArr); if (!$recordAccess) { $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']); @@ -5574,9 +5574,11 @@ * * @param string Record table * @param integer Record UID + * @param array Record data + * @param array Hook objects * @return boolean Returns true if the user may update the record given by $table and $id */ - function checkRecordUpdateAccess($table,$id) { + function checkRecordUpdateAccess($table, $id, $data=false, &$hookObjectsArr=false) { global $TCA; $res = 0; if ($TCA[$table] && intval($id)>0) { @@ -5586,6 +5588,13 @@ } elseif ($this->doesRecordExist($table,$id,'edit')) { $res = 1; } + if (is_array($hookObjectsArr)) { + foreach($hookObjectsArr as $hookObj) { + if (method_exists($hookObj, 'checkRecordUpdateAccess')) { + $res = $hookObj->checkRecordUpdateAccess($table, $id, $data, $res, $this); + } + } + } $this->recUpdateAccessCache[$table][$id]=$res; // Cache the result } return $res;