title: CakePHP Auth how to allow specific controller and actions
body: <p>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".</p>
  
  <p>In my app_controller.php I have this </p>
  
  <pre><code>$this-&gt;Auth-&gt;allow('signup', 'confirm', 'index');
  </code></pre>
  
  <p>but with that all users can visit post.index and user.index. How can I specify a Controller in the allow-method?</p>
  
  <p>This didn't work for me:</p>
  
  <pre><code>$this-&gt;Auth-&gt;allow('signup', 'confirm', 'Post.index');
  </code></pre>
  
  <hr>
  
  <p><strong>update</strong>
  I removed 'index' from the app_controller.php and instead set it in the beforeFilter method in the post controller:</p>
  
  <pre><code>function beforeFilter() 
  {
      parent::beforeFilter();
      $this-&gt;Auth-&gt;allow('index');
  }
  </code></pre>
  
  <p>I also set a variable "loggedIn" in app_controller, without calling "parent::beforeFilter();" I got an "undefined variable" notice.</p>
  
  <p>thx <a href="https://stackoverflow.com/users/232542/sibidiba">sibidiba</a></p>