authentication - Allowing a Specific Page in Cakephp -


i understand how allow controller actions non-logged in users. but, can't find documentation on how allow access specific pages. controller pages , action display. but, don't want allow user see pages, page.

so, correct way allow guests access some, not all, pages?

i'm afraid can't using standard functions authcomponent gives you. have create own logic in pages_controller's display action.

something (pseudo-code style)

# in app/controllers/pages_controller.php var $allowedpages = array('one', 'two');  function display($page) {     if(in_array($page, $allowedpages) || $this->user->loggedin) {         $this->render($page);     } else {         $this->render('not_allowed');     } } 

Comments