我遇到了zend_acl的一个奇怪问题,我已经成功添加了角色和资源,但isAllowed()函数总是重定向到错误控制器。
$usersNs->role = 'admin';
$acl->addRole(new Zend_Acl_Role($usersNs->role));
$acl->add(new Zend_Acl_Resource("dashboard::stats"));
$privilageName = $request->getControllerName()."::".$request->getActionName();
if($acl->has($privilageName)){
echo "has privelage"; //echo every time whenever i go to dashboard,stats
}
if(!$acl->isAllowed($usersNs->role,$privilageName )) {
$request->setControllerName('error');
$request->setActionName('error');
}