Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top