[TYPO3-core] RFC: #2278 - Hook request for t3lib_TCEmain::checkModifyAccessList()

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Nov 8 09:19:08 CET 2006


Peter Niederlag schrieb:
> Ernesto Baschny [cron IT] schrieb:
>> Michael Stucki schrieb:
> [...]
>> The function returns "true if the user has general access to modify the
>> $table". What is unclear if several extensions hook to this method. In
>> the current suggestion, the "last hook" wins (be it true or false). I
>> would rather have it return in a determinate way, for example:
>>
>> - if all hooks PLUS default handling returns "TRUE" => return TRUE
> 
> that wouldn't enable what the original hook-author wanted to accomplish:
> He wanted to *override* the denial of modification.

My suggestion works for the case the hook-author needs it: overriding a
positive $res with a negative result.

TYPO3 tells the caller that the user can modify/delete a record
(checkModifyAccessList returning true), but the hooks author wants to
disallow it if the request is to specifically to delete the record. So
the hook returns false on this situation, and the whole construct
returns false (true && false = false).

But you are right that "allowing modifications even if TYPO3 would
reject it" wouldn't be possible if we change the code to my suggested
modification.

> How about *ignoring* the default result and requiring *all  hooks* to
> return true? That would need a different patch though.

That would also be a deterministic handling, and I could live with it.

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list