Great question, as Daniel Castro said the plugin is located at https://github.com/cakephp/acl .
The invalid part is to override "isAuthorized" in your "AppController.php" with something like:
... use Acl\Controller\Component\AclComponent; use Cake\Controller\ComponentRegistry; ... public function isAuthorized($user){ $Collection = new ComponentRegistry(); $acl= new AclComponent($Collection); $username=$user['username']; $controller=$this->request->controller; $action=$this->request->action; $check=$acl->check($user['username'],"$controller/$action"); return $check; }
Someone is wiser than I will know better if the user / action / controller bits can be better sanitized. There are many warnings about the stability of this plugin and "gotchas" on acl in terms of performance.
I move on to implementation 1.3, it was useful to add to the AppController 'initialize' info from http://book.cakephp.org/3.0/en/controllers/components/authentication.html
Marc
source share