How to load pages which are not intregrated in ACL of cakePHP

38 Views Asked by At

I have implemented ACL using cakeDC plugin. Basically i want to make an app where everyone can view all pages. Only register people can view admin panel. Currently My app loading Login page initially and after login i can view the content as i have add the bellow code into App controller.

class AppController extends Controller
{
    public function initialize()
    {
        parent::initialize();

        $this->loadComponent('RequestHandler', [
            'enableBeforeRedirect' => false,
        ]);
        $this->loadComponent('Flash');

        $this->loadComponent('Acl', [
            'className' => 'Acl.Acl'
        ]);
        $this->loadComponent('CakeDC/Users.UsersAuth');
     }
}

Now only one path is excepted int the routes.php

$routes->connect('/', ['controller' => 'Articles', 'action' => 'index']);

My question is how can i load other Pages, Action,methods before ACL occurs?

1

There are 1 best solutions below

0
A.A Noman On

In your Controller you make a function like this. This function can't include in ACL

public function beforeFilter() {

    $this->Auth->allow('controller' => 'Articles', 'action' => 'index']);

}