1

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?

Md . Sojib Ahmed
  • 431
  • 4
  • 14

1 Answers1

0

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']);

}
A.A Noman
  • 5,244
  • 9
  • 24
  • 46