+2010-04-10 Steffen Kamper <info@sk-typo3.de>
+
+ * Fixed bug #485: Hookrequest for ~ TemplaVoila unlink doesn't work for Non-Admins (thanks to Tolleiv Nietsch)
+
2010-04-10 Stanislas Rolland <typo3@sjbr.ca>
* Added feature #14051: htmlArea RTE: Streamline the RTE loading process
2010-04-10 Stanislas Rolland <typo3@sjbr.ca>
* Added feature #14051: htmlArea RTE: Streamline the RTE loading process
$status = 'new'; // Yes new record, change $record_status to 'insert'
} else { // Nope... $id is a number
$fieldArray = array();
$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']);
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']);
*
* @param string Record table
* @param integer Record UID
*
* @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
*/
* @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) {
+ $res = NULL;
+ if (is_array($hookObjectsArr)) {
+ foreach($hookObjectsArr as $hookObj) {
+ if (method_exists($hookObj, 'checkRecordUpdateAccess')) {
+ $res = $hookObj->checkRecordUpdateAccess($table, $id, $data, $res, $this);
+ }
+ }
+ }
+ if($res === 1 || $res === 0) {
+ return $res;
+ } else {
+ $res = 0;
+ }
+
if ($TCA[$table] && intval($id)>0) {
if (isset($this->recUpdateAccessCache[$table][$id])) { // If information is cached, return it
return $this->recUpdateAccessCache[$table][$id];
if ($TCA[$table] && intval($id)>0) {
if (isset($this->recUpdateAccessCache[$table][$id])) { // If information is cached, return it
return $this->recUpdateAccessCache[$table][$id];