cakephp验证拒绝

cakephp验证拒绝,php,cakephp,Php,Cakephp,我正在使用Cakephp1.3,我想拒绝一些函数 这是我在用户控制器中编写的代码 function beforeFilter(){ parent::beforeFilter(); $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->authorize = 'controller';

我正在使用Cakephp1.3,我想拒绝一些函数

这是我在用户控制器中编写的代码

  function beforeFilter(){
     parent::beforeFilter();
     $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
     $this->Auth->authorize = 'controller';     
  }    
 function isAuthorized() {    
     $this->deny('delete');
     return true;    
}
但我仍然可以访问删除功能。我想停止访问删除功能。 提前谢谢

function isAuthorized() {    
    if ($this->action == 'delete') return false;  
}

我会放一个公关;语句内部的某个地方被授权,只是为了确保您至少能够使用该函数

父项:beforeFilter;应该是parent::beforeFilter;我尝试了这个仍然不起作用尝试$this->Auth->deny'delete在你的beforeFilter函数中!!我试过了,但仍然不起作用。你允许的部分怎么样?你能用var_dump$this->Auth->allowedActions查看你是否有delete吗?你能在登录前访问delete吗?是的,我知道这个解决方案,但我想用deny而不是returnfalse;