Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3320288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:55:32+00:00 2026-05-17T22:55:32+00:00

I am building an application using cakePHP. Do we have a method where we

  • 0

I am building an application using cakePHP. Do we have a method where we can allow public users access to certain pages without logging in. There would be a few pages such as about us regarding the whole organisation or a contact us page. Is there a method to avoid login access, something similar to how we have ways to add components or set layouts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:55:32+00:00Added an answer on May 17, 2026 at 10:55 pm

    As Martin Bean says, you can use ACL. For a sophisticated site, that would be my choice. You do not have to be logged in to access the public pages. http://multiheadweighers.co.uk is an example of a site that uses ACL. There is a fully featured CMS behind the public pages.

    For a simple site I would allow access to, for instance, the view action using

    function beforeFilter() {
        parent::beforeFilter;
        $this->Auth->allow('view');
    }
    

    see: http://book.cakephp.org/view/1257/allow

    It really isn’t a big deal – try it and you’ll see how easy it is.

    EDIT:

    From the book @ http://book.cakephp.org/view/1550/Setting-up-permissions

    Now we want to take out the references
    to Auth->allowedActions in your users
    and groups controllers. Then add the
    following to your posts and widgets
    controllers:

    function beforeFilter() 
    {    
        parent::beforeFilter();     
        $this->Auth->allowedActions = array('index', 'view');
    }
    

    This removes the ‘off switches’ we put in earlier on the users and groups controllers, and gives public access on the index and view actions in posts and widgets controllers. In AppController::beforeFilter() add the following:

     $this->Auth->allowedActions = array('display');
    

    This makes the ‘display’ action public. This will keep our PagesController::display() public. This is important as often the default routing has this action as the home page for you application.

    EDIT 2:

        $user = ($this->Auth->user())?$this->Auth->user():'Anonymous';
        if(!$this->Acl->check($user,"{$url}"))
            $this->redirect($this->referer()); // or whatever action you want to take.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a prototype search application using CakePHP and I have a search controller
I'm currently building an application using Sencha Touch. We have a certain Carousel on
I am currently building an application using ASP.NET MVC. The data entry pages are
I'm building an application in C# using WPF. How can I bind to some
I have a simple application using netbeans for developing and maven for building et
I am building an application using Raphaël. I have done my work on vectors,
I'm building a PHP application using the data mapper pattern to separate my DB
I've just been tasked with building a web application using ASP (.net) and am
I'm am building my asp.net web application using MVC (Preview 5), and am also
I'm building a MVC web application (using the Spring MVC framework), and I'm a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.