Posted By

TioSolid on 05/14/10



Viewed 1 times

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


RSS Icon Subscribe to comments

You need to login to post a comment.