I check permissions in onConstruct method and want to stop any action execution if access is denied, but to render standard layout as usual. If possible not redirecting to another page. Why, i write below. How to do the stop.
There is $this->response->redirect('authentication/accessdenied'); which i want to use to redirect to a page with user friendly information. If i must use response->redirect i've noticed a problem. The problem is after the execution of the redirect method i had been able to do some php instructions before redirect actually worked. In my case php die() function worked faster. Not sure whether this can cause some insesure stuff/instructions to be executed in this time gap.
I know there is _finish property in the dispatcher object. I understand i cannot change it to stop the controller flow
There is as i remember an beforeExecuteRoute what i couldn't use returning true or false to stop the flow or not, yet the method/event generally works.