You're '*' in allow in AppController won't make a bit of difference in
your products controller because you're not using parent::beforeFilter
(). You generally want to use parent::beforeFilter() (or any
callback function) whenever you define a new beforeFilter in your
controller extending AppController.
function beforeFilter(){
parent::beforeFilter();
$this->Auth->allow('show');
}
Chances are you're doing that, but I didn't see that in your example.
Another thing I suggest looking for are actionRequest calls in your
views/elements/layouts that aren't being allowed thus giving you the
illusion the page you're asking for (URL) isn't being allowed but in
fact its another action you forgot to 'allow'.... that will bite me
every now and then. I highly suggest the debug_kit plugin because it
will show you what's going on behind the scenes of each request.
Hope that helps,
On May 22, 10:02 am, Roman Brunnemann <[email protected]> wrote:
> Hi,
>
> I am using Auth and most of it works fine. But when I want to call a
> page directly as
>
> http://localhost/products/show/
>
> it says ""You are not authorized to access that location.".
>
> So I went in the products controller and made a
>
> function beforeFilter() {
>
> $this->Auth->allow('show');
> }
>
> but it didn't help.
>
> Even a change of the AppController didn't make any difference.
>
> class AppController extends Controller {
>
> var $component = array('Auth');
>
> function beforeFilter() {
>
> $this->Auth->allow('*'); //allow every action of every controller
> }
>
> }
>
> Do you have any idea why the access is still blocked?
>
> Thanks a lot.
> Roman
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---