I understand your question. I suggest you make your application modular. For an ACL, just move it (and also make your modules resources)!
eg.
// ROLES $this->addRole(new Zend_Acl_Role('guest')); // default $this->addRole(new Zend_Acl_Role('Marketing'), 'guest'); // 15 // RESOURCES (MY MODULES) $this->add(new Zend_Acl_Resource('auth')); $this->add(new Zend_Acl_Resource('takeon')); // PRIVILEGES // // default $this->deny(); // // guest $this->allow('guest', 'auth'); // 15 Marketing $this->allow('Marketing', 'default'); $this->allow('Marketing', 'takeon', array('index', 'ben10cards'));
Then in your plugin use:
// OBTAIN CONTROL LIST $acl = new Auth_Model_Acl(); // OBTAIN RESOURCE $module = $request->getModuleName(); $controller = $request->getControllerName(); // VALIDATE if ($acl->isAllowed($role, $module, $controller)) { $allowed = true;
Then you may not have resources for action, but better for me :)
source share