I want to create some permission to my site in cakephp but not works permission check.
I want only for example allow only the page add the other page like index or register doesn't have access.
This is my AppController component
public $components = array(
'Session',
'Auth' => array(
'loginAction' => array('controller'=>'users','action'=>'login', 'admin'=>false),
'logoutRedirect' => array('controller'=>'users','action'=>'logout'),
'loginRedirect' => array('controller'=>'shows', 'action'=>'index'),
'authError' => 'Questa risorsa non sembra appartenere al tuo account, oppure non hai eseguito l\'accesso',
'autoRedirect' => false,
'authorize' => array(
'Controller',
'Actions' => array(
'actionPath' => 'controllers'
)
),
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'email')
)
)
)
);
And this is the beforeFilter inside UserController:
public function beforeFilter () {
parent::beforeFilter();
$this->Auth->deny('*'); //I have also tried $this->Auth->deny();
$this->Auth->allow('register');
}
Why I can access to the other pages? Thanks