CakePHP Auth how to allow specific controller and actions

Posted by nolandark on Stack Overflow See other posts from Stack Overflow or by nolandark
Published on 2010-05-08T10:03:25Z Indexed on 2010/05/08 10:08 UTC
Read the original article Hit count: 204

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');

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about authentication