【发布时间】:2010-11-11 08:37:46
【问题描述】:
$this->add ( new Zend_Acl_Resource ( 'index' ) );
$this->addRole ( new Zend_Acl_Role ( 'guest' ) );
$this->allow('guest', 'index','view');
我在这种情况下有问题
if (! $this->_acl->isAllowed ( $role, $resource, $action )){
... redirect to access denied
}
- 允许访客访问 Contoller index 和操作 view。
- 但是当他输入 url /index/view2 时,它应该将他重定向到错误页面,因为操作 view2 不存在
- 但是这个条件是他被允许查看动作视图。所以它不是将他重定向到错误页面,而是访问被拒绝
如何解决这个问题?
【问题讨论】:
-
也许一些使用反射类会有所帮助! php.net/manual/en/class.reflectionmethod.php
标签: zend-framework action zend-acl