CakePHP Auth Component, function allow with parameter "*" doesn't work

577 views Asked by At

I'm a beginner on cakePHP and I have a problem with Auth Component. The function allow of Auth doesn't work for permission of all (*). The code is this:

    <?php

App::uses('Controller', 'Controller');

class AppController extends Controller {



    public $components = array(
        'ACL',
        'Auth' => array(
            'authorize' => array(
                'Actions' => array('actionPath' => 'controllers')
            )
        ),
        'Session'
    );

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

}

All actions redirecting to the login action. The function allow really doesn't work as planned.

1

There are 1 answers

1
rcarvs On BEST ANSWER

I resolve the problem... I used the function with parameter empty. It worked

    <?php

App::uses('Controller', 'Controller');

class AppController extends Controller {



    public $components = array(
        'ACL',
        'Auth' => array(
            'authorize' => array(
                'Actions' => array('actionPath' => 'controllers')
            )
        ),
        'Session'
    );

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

}

Thanks