CakePHP Auth how to allow specific controller and actions
- by nolandark
I have a "Posts" and a "Users" controller. I use the Auth Component and I want that all users can visit "Post.index" but only logged in users can visit "User.index".
In my app_controller.php I have this
$this->Auth->allow('signup', 'confirm', 'index');
but with that all users can visit post.index and user.index. How can I specify a Controller in the allow-method?
This didn't work for me:
$this->Auth->allow('signup', 'confirm', 'Post.index');