[TYPO3-english] Re: Extabse access check best practice
Viktor Livakivskyi
invisible.kinder at gmail.com
Wed Sep 9 10:01:05 CEST 2015
Hi, Hannes
> Now that I think about it, the two methods can be combined, as the
> actionName based authorize helper could call the model based one.
>
> Something like:
>
> switch($controllerName) {
> case: 'ExampleController':
> switch($actionName) {
> case 'show':
> $object = $actionArguments[0];
> $authorizeHelper->$authorize(
> $object,
> AuthorizeHelper::READ
> )
> break;
> }
> break;
> }
>
> return false; // leads to $GLOBALS['TSFE']->pageUnavailableAndExit(...)
This sounds like a plan! While I don't like switch-case constructions, in this task it seems quite okay to use them.
Thank you for your input. I've got, that it is not really a validation, because in case of access violation no validation should be performed at all, but process terminated.
More information about the TYPO3-english
mailing list