2013-08-28 62 views
0

當我嘗試讓這樣如何允許使用安全組件進行操作?

public function beforeFilter() { 
      parent::beforeFilter(); 
      $this->Security->allowedActions(array('sign-up')); 
      $this->Auth->allow('login','signup','index','activate','logout','forgot','reset','display'); 
      if($this->Auth->user('id')) { 
       $this->set('logged_in', true); 
      } else { 
       $this->set('logged_in', false); 
      } 
     } 

     public $components = array('RequestHandler'); 

在控制器singup行動,如果我刪除

$this->Security->allowedActions(array('sign-up')); 

當我提交申請表單,我收到此錯誤

Call to undefined method SecurityComponent::allowedActions()  

,這表明您的要求有本黑檀

回答

相關問題