开发者

Why would Auth->allow be ignored in my controller in CakePHP?

开发者 https://www.devze.com 2023-03-19 02:42 出处:网络
I have a controller that I am setting the Auth->allow() to a group of about 15 actions. This was working as expected allowing visitors to view the allowed pages without any issues until recently. I

I have a controller that I am setting the Auth->allow() to a group of about 15 actions. This was working as expected allowing visitors to view the allowed pages without any issues until recently. I say recently because I just discovered it is not working, but I'm not sure when it stopped working.

If I add $this->Auth->allow('*'); to the controller in question it then works开发者_C百科, with the exception that if you manually type in an address that should be blocked it gives an error page instead of redirecting to the login page.

I even tried to set the Auth->allow in my app_controller but it still acts as if I did not, unless I set it to the wild card * in the controller in question.

Where can I start debugging this annoying issue?

Upon further investigation I added a ChromePhp::log() to the auth.php allow() function and discovered that with my list of allowed actions placed in the app_controller they do show up when displayed via my debug, nonetheless it still doesn't load the home page which is in the list, instead it redirects to the login page.

0

精彩评论

暂无评论...
验证码 换一张
取 消