Hi,
I handle my ACL/Auth in a plugin. However I notice that more and more
controllers need to have specific ACL management. Per consequent, I have a
lot of:
if($this->getControllerName === 'xyz') { ... } else { ... } in my plugin.
Not very clean code, I'm sure you agree )
I'm thinking about a little refactor and move the ACL/Auth management to
several ActionHelpers (and avoid all those if statements). Beause if I have
read right, using ActionHelpers will allow me to have ACL/Auth management
for specific controllers.
The advantage of a plugin was that you don't need to "include" anything. I
mean, if you use an ActionHelper you need something like :
this->_helper->getHelper('aclHelper')->... in each of your controllers!
But what if a programmer forget to include this instruction in a controller
? This controller will be accessible even if it is not supposed to be.
By using a plugin however, you don't have to worry about this, as every
request will be processed by your plugin anyway.
I would like to enable this->_helper->getHelper('aclHelper')->... in an
extended controller, that would be the default behaviour for all subclasses
(controllers).
But if a controller needs a specific behaviour, then I would like to
override that ACL ActionHelper.
(Something like: before to call the custom parent Zend_Action_Controller,
use possibly an Actionhelper, and then in the parent, detect if there was
already an ActionHelper called regarding ACL, if not, call the default
helper).
I hope that my question was clear.
Is this possible ?
Thank you for any adive,
Matt.
--
View this message in context:
http://www.nabble.com/Overriding-an-ActionHelper-for-a-controller-tp25202323p25202323.html
Sent from the Zend Framework mailing list archive at Nabble.com.