In my controller I have some actions with redirects to another actions. For example:
public function editAction()
{
$this->_forward('add');
}
I'd like to allow user only access the editAction, but I need give him access to addAction too. There is any way to give him only access to editAction even if it redirects to addAction?
Thank you.
The best way to do this kind of control over your application is ingecting a plugin on yout bootstrap so the action is verified before it reaches the controller.
You need to write a plugin that extends Zend_Controller_Plugin_Abstract and override the preDispatch function, which has as a parameter a request object. From the request you can get controller name and action name and that's when you validate it from you ACL rules and redirect the user wherever you want.
This way you don't have to put a lot of rules on your controllers and keep safe on a plugin. Hope it helps.