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 6946421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:33:47+00:00 2026-05-27T13:33:47+00:00

All, Here I am with CakePHP ACL again. After many headaches, I was able

  • 0

All,

Here I am with CakePHP ACL again. After many headaches, I was able to get Alaxos ACL to work for me. I set group permission, etc, and it works great. However, I am having issue with one controller that does not make sense to me at all…

  • In this controller articles_controller.php it looks like beforeFilter() has not effect

In my app_controller.php I have

function beforeFilter(){
    ...
    $this->Auth->allow('display') //To make sure all my pages are plublic, like about_us
}

In all my controllers including articles_controller.php I have the following code

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

However, when I access this controller neither the index or view actions works. I get a YOU ARE NOT AUTHORIZED TO ACCESS THAT LOCATION error. The only time that controller works is if I change the $this->Auth->allow('display') to(‘*’) in the app_controller.php‘s beforeFilter().

I am not sure what to do. Isnt $this->Auth->allow('index','view') making these 2 actions public regardless of ACL says? I am only able to access them when logged in. Same actions in other controllers work just fine. Nothing else is out of the ordinary…

What can I do, or where should I look next. Why?

===========================================================================================

And to add,

I have the following code in my articles_controller.php:

 $this->set('articles',$articles);
 $this->set('topfive_articles',$topfive_articles);
 $this->set('other_articles',$other_articles);
 $this->set('categories',$categories);

If I comment all those out, AUTH now gives me access to the action/view, but it displays undefined variable errors. Also, if I comment out, ie. 3 of 4, nothing happens. I only get thru if I comment out all 4 variables….

I have not idea what is going on…

  • 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-27T13:33:48+00:00Added an answer on May 27, 2026 at 1:33 pm

    ================================================================================

    After many hours of researching and trying I came to a simple conclusion that was so obvious that I am not sure why I missed it.

    In articles_controller.php I have other actions besides index, view, edit, delete, admin_xxx. I have among others getArticleComments, mostViewedArticle

    I am not sure if it is the correct way, most likely it is not, but I use requestAction to process these actions and most into an ELEMENT which is displayed in the view.

    I basically had to tell Auth to allow these actions to be public as well as the index and view.

    $this->Auth->allow(
                'index',
                'view',
                'getTotalComments',
                'mostComments',
                'childrenComments',
                'getRelated',
                'getArticleComments',
                'mostViewed'
         );
    

    Voila! As soon as I did that, problem solved… WOW!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here are a few possibilities to get the conversation started: Escape all input upon
I created a website with CakePHP, set up all of the permissions so guests
Hey all, have a slight problem here. In CakePHP I have a controller that
in CakePHP book example here I try: cake bake all then I choose 1
I have set up Auth and ACL successfully on my cakePHP app. How, now
It's not the first time I set up POEdit to work with CakePHP, but
Asking this question here because in CakePHP google group got no answer.I have the
enter code here Hi All, I have a simple windows service application that connects
I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get
Here's the goal: to replace all standalone ampersands with & but NOT replace those

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.