Posted By

TioSolid on 05/14/10


auth cakephp

Versions (?)

Allow access to a specific action (ACO)

 / Published in: PHP


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)
  3. function beforeFilter() {
  4. $this->Auth->allow('index','view');
  5. }

Report this snippet  

You need to login to post a comment.