在我的项目中,大约有 5、6 个模块
Ex: Web - Public access, URL - www.abc.com
Admin - admin can access - admin.abc.com (Non Acl)
CP - Specific group can access - cp.abc.com (Non Acl)
pbo - Another group can access - pbo.abc.com (Acl based and implemented recently)
如上所述,我们最近添加了一个名为 PBO 的模块,基于 ACL 插件,
每个模块都有一个特定的引导文件,
但是新模块执行后,其他所有模块都通过ACL插件重定向到PBO模块的默认页面。
权限是这样设置的
$this->acl->allow('superAdmin', 'user', array('login','logout'));
$this->acl->allow('superAdmin', 'index', 'index');
$this->acl->allow('superAdmin', 'app', 'index');
$this->acl->allow('admin', 'user', array('index','login','logout','registered'));
$this->acl->allow('admin', 'index', 'index');
$this->acl->allow('admin', 'app', array('index', 'do-feature', 'do-delete'));
在引导文件中初始化 ACL
public function _initAcl()
{
//Omit the process in CLI mode
if (php_sapi_name() != 'cli')
{
$helper = new Nexva_Controller_Action_Helper_AclPbo();
$helper->setRoles();
$helper->setResources();
$helper->setPrivilages();
$helper->setAcl();
//Register the ACL plugin - Then it will be called automatically,whenever an acion is called
$frontController = Zend_Controller_Front::getInstance();
$frontController->registerPlugin(new Nexva_Plugin_AclPbo());
}
}
有什么方法可以避免在其他模块中调用 PBO 模块的 ACL 吗?