Posted By

TioSolid on 05/14/10


Tagged

auth cakephp


Versions (?)

Allow access to a specific action (ACO)


 / Published in: PHP
 

URL: http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables

Another common use of Auth component variables is to allow access to certain methods without the user being logged in (by default Auth restricts access to every action except the login and logout methods).

  1. //For example if we want to allow all users access to the index and view methods ( but not //any other), we would do the following (inside a controller)
  2.  
  3. function beforeFilter() {
  4. $this->Auth->allow('index','view');
  5. }

Report this snippet  

You need to login to post a comment.