This was the approach I was originally going to take, however you run
into a problem if you want to customise your views based on what
resources a user has permission to access, because the permissions for
all controllers will not be known. If you don't want to do that, or you
only want to customise views within the same controller then I think
that approach would be fine. But that's just my opinion, and I'm no expert.
Douglas Hammond wrote:
To help with auth and acl I made an action helper that automatically
checks permissions on preDipatch.
My question is would it be bad practice to setup the acl for that
controller in the init like this:
public function init()
{
$acl = $this->_helper->getHelper('Auth')->getAcl();
$acl->add(new Zend_Acl_Resource('default'));
$acl->add(new Zend_Acl_Resource('default.error'), 'default');
$acl->add(new Zend_Acl_Resource('default.index'), 'default');
$acl->allow('guest', 'default');
}
This makes it simple for me to manage the acl on a per controller basis
or should I stick all the acl controls in my custom acl class?
--
Jack