« Return to Thread: Zend_Acl / Zend_Auth example scenario

Re: Zend_Acl / Zend_Auth example scenario

by Mark Maynereid :: Rate this Message:

Reply to Author | View in Thread

Hi,

I've have also found this problem that the auth plugin breaks the error handler plugin on 404 Page not found requests.  Make sense to me. The auth plugin is run in preDispatch while the built-in error handler plugin doesn't get a look in until postDispatch.

A perhaps undesirable fix that works for me is to replace:
if (!$this->_acl->has($resource)) {
    $resource = null;
}
with:
if (! $this->_acl->has($resource)) {
    return;
}
in the auth plugin.

This means the plugin enforces only on resources it's been told about. So allowing the error handler access to requests that turn out to be 404 page not found. But if you forget to register a controller as a an acl resource the whitelist policy is lost for that controller. Not ideal maybe.

Has anyone got a better fix?

Regards,
Mark

ps.
I get behaviour regardless of $front->throwExceptions() settings.

paperogiallo wrote:
Hi Simon,
I really appreciate your ideas, and with some efforts due to ZF-code modification in the mean time, I've understood quite all you posted. So, thanks a lot. :)

But...

1) the plugin seems to "intercept" all requests, even those to non-existent controllers or actions: is it a matter of hook in the request&dispatch loop? Is there any patch to this (supposed) bug?

 « Return to Thread: Zend_Acl / Zend_Auth example scenario