Project

General

Profile

Bug #15425 » bugtracker_hook.txt

Administrator Admin, 2006-01-16 09:22

 
hook-enhanced class.t3lib_tcemain.php:

function checkModifyAccessList($table) {
global $TYPO3_CONF_VARS;
$hookObjectsArr = array();
if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'])) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'] as $classRef) {
$hookObjectsArr[] = &t3lib_div::getUserObj($classRef);
}
}
$res = ($this->admin || (!$this->tableAdminOnly($table) && t3lib_div::inList($this->BE_USER->groupData['tables_modify'],$table)));

foreach($hookObjectsArr as $hookObj) {
if (method_exists($hookObj, 'recheckModifyAccessList')) {
$hookObj->recheckModifyAccessList($table, $this->cmdmap, $this, &$res);
}
}
return $res;
}


hook used in extension civserv class.tx_civserv_commit.php:

function recheckModifyAccessList($table, $cmdmap, $pObj, &$res){
if (isset($cmdmap) && isset($cmdmap['tx_civserv_model_service_temp'])){
foreach($cmdmap['tx_civserv_model_service_temp'] as $id => $incomingCmdArray) {
if (is_array($incomingCmdArray)) {
reset($incomingCmdArray);
$command = key($incomingCmdArray);
if (!$pObj->admin && $command = 'delete') $res = 0;
}
}
}
}


...the crucial bit is setting the result to zero, which triggers the "you do not have the right" warning for the editor and prevents the command from being enacted.
(1-1/6)