在我的项目大约有5,6个模块Zend的模块特定ACL
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中的其他模块?