ACL and Auth in cakephp
Since learning cakePHP , has not finished understanding the ACL, but also checked a lot of information, but the use of it is smattering, ACL should be a more difficult to understand cakephp, these days again read the manual, found that the ACL does not believe in the difficult, But it's better than I thought. Welcome to reprint and visit my website http://www.batterylaptops.co.uk
Now let me say that the specific usage of it should be noticed in the process of using the problem
Pre-preparation work:
It is best to be able to configure the bake, so that the bake name is valid, although this is not necessary, but there is this command-line tool we will be more convenient
Import the following SQL statement in your database
- CREATE TABLE Users (
- ? ? ID INT (one) not NULL auto_increment PRIMARY KEY,
- ? ?? ??? Username VARCHAR (255) is not NULL UNIQUE,
- ? ? Password CHAR (+) not NULL,
- ? ? group_id INT (one) is not NULL,
- ? ? Created DATETIME,
- ? ? Modified DATETIME
- );
- CREATE TABLE groups (
- ? ? ID INT (one) not NULL auto_increment PRIMARY KEY,
- ? ? Name VARCHAR (+) is not NULL,
- ? ? Created DATETIME,
- ? ? Modified DATETIME
- );
- CREATE TABLE Posts (
- ? ? ID INT (one) not NULL auto_increment PRIMARY KEY,
- ? ? USER_ID INT (one) is not NULL,
- ? ? Title VARCHAR (255) Not NULL,
- ? ? Body TEXT,
- ? ? Created DATETIME,
- ? ? Modified DATETIME
- );
- CREATE TABLE Widgets (
- ? ? ID INT (one) not NULL auto_increment PRIMARY KEY,
- ? ? Name VARCHAR (+) is not NULL,
- ? ? Part_no VARCHAR (12),
- ? ? Quantity INT (11)
- );
Here we use the Cake bake all command tool to quickly generate models, controllers, and views (here I'll explain in detail how to use the bake command in cakephp)
Next, prepare to use Auth component certification
First we open the users_controller.php in the Userscontroller class to add login logout action
- function Login () {
- ? ? Auth Magic
- }
- function logout () {
- ? ? Leave empty for now.
- }
- Then create the view file APP/VIEWS/USERS/LOGIN.CTP
-
- $session->flash (' auth ');
- echo $form->create (' User ', Array (' action ' = ' login ');
- echo $form->inputs (Array (
- ? ?? ???' Legend ' = ' + __ (' Login ', true),
- ? ?? ???' Username ',
- ? ?? ???' Password
- ));
- echo $form->end (' Login ');
- ?>
Next we need to modify AppController (/app/app_controller.php), if you do not have app_controller.php file under the app directory, you can create a
-
- Class AppController extends Controller {
- ? ? var $components = array (' ACL ', ' Auth ');
- ? ? function Beforefilter () {
- ? ?? ??? Configure authcomponent
- ? ?? ??? $this->auth->authorize = ' actions ';
- ? ?? ??? $this->auth->loginaction = Array (' controller ' = ' users ', ' action ' = ' login ');
- ? ?? ??? $this->auth->logoutredirect = Array (' controller ' = ' users ', ' action ' = ' login ');
- ? ?? ??? $this->auth->loginredirect = Array (' controller ' = ' posts ', ' action ' = ' add ');
- ? ? }
- }
- ?>
Next we need to modify the Groupscontroller and Userscontroller, the two files directory everyone should know where it is.
Add the following code to the two controllers separately
- function Beforefilter () {
- ? ? Parent::beforefilter ();
- ? ? $this->auth->allowedactions = Array (' * ');
- }
In fact, this code is meant to allow users to access all the user and group action, of course, this is to be changed back
Next we're going to initialize the ACL table
Because now we have only four tables in our database, and we haven't imported ACL tables.
We use the following statement to import the ACL table into the database
On the command line, enter cake schema run Create Dbacl
We follow the prompts to import the table
Next we need to modify the user and group model
First we open the user.php in the Model directory and add the following code (in fact you can replace it with the following code)
- var $name = ' User ';
- var $belongsTo = array (' Group ');
- var $actsAs = array (' Acl ' = ' requester ');
- function ParentNode () {
- ? ? if (! $this->id && Empty ($this->data)) {
- ? ?? ??? return null;
- ? ? }
- ? ? $data = $this->data;
- ? ? if (Empty ($this->data)) {
- ? ?? ??? $data = $this->read ();
- ? ? }
- ? ? if (! $data [' User '] [' group_id ']) {
- ? ?? ??? return null;
- ? ? } else {
- ? ?? ??? Return Array (' Group ' = = Array (' id ' = = $data [' User '] [' group_id ']);
- ? ? }
- }
Copy Code
Then modify the group model
- var $actsAs = array (' Acl ' = = Array (' requester '));
- function ParentNode () {
- ? ? return null;
- }
Well, to this point we need to temporarily stop, now in the browser open the corresponding user and group page, add user and group, such as my, I opened http://localhost/cakephp/groups Add Group, open HTTP// localhost/cakephp/users/Add users, here we add three groups and three users
After adding it, you can open the phpMyAdmin and look at the Aros table to see if there are any more records.
It's amazing, isn't it? Haha, this is the charm of the frame, so far the table related to the ACL, only the records exist in the Aros table
We also have to modify the Aros table records when we modify each of the user users later
All we should do is add the following code to the user model
- /**? ?
- * After Save callback
- *
- * Update The ARO for the user.
- *
- * @access Public
- * @return void
- */
- function Aftersave ($created) {
- ? ?? ??? if (! $created) {
- ? ?? ?? ?? ? $parent = $this->parentnode ();
- ? ?? ?? ?? ? $parent = $this->node ($parent);
- ? ?? ?? ?? ? $node = $this->node ();
- ? ?? ?? ?? ? $aro = $node [0];
- ? ?? ?? ?? ? $aro [' Aro '] [' parent_id '] = $parent [0][' Aro '] [' id '];
- ? ?? ?? ?? ? $this->aro->save ($aro);
- ? ?? ???}
- }
Here we have ARO created, and then we're going to create a good aco.
We should know that the nature of the ACL is used to define when an ARO can access an ACO component, and it becomes easy to understand.
For simplicity we use the command line to execute the cake ACL create ACO root controllers
You can now open the Acors table with phpMyAdmin, you should see that there is already a record in the table, this record is the result of just executing this command, of course, we do not have to use the command line tool.
Next we need to modify the next AppController, in the inside of the Beforefilter method we need to add a line $this->auth->actionpath = ' controllers/';
Here are the main points, there may be many controllers and methods in our app project, we need to add each action to the Acors table for permission control, of course, if you are not afraid of trouble can be a manual add, but I think most programmers are still very lazy, All we need here to use the Auto build tool
Here we add the following code in the users_controller.php, of course you can also put in the other controller
I'll add the following code to the users_controller.php
- function Build_acl () {
- ? ?? ?? ?? ?? ? if (! Configure::read (' Debug ')) {
- ? ?? ?? ?? ?? ?? ?? ?? ? return $this->_stop ();
- ? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ? $log = Array ();
- ? ?? ?? ?? ?? ? $aco =& $this->acl->aco;
- ? ?? ?? ?? ?? ? $root = $aco->node (' controllers ');
- ? ?? ?? ?? ?? ? if (! $root) {
- ? ?? ?? ?? ?? ?? ?? ?? ? $aco->create (' parent_id ' = null, ' model ' = null, ' Alias ' = ' controllers '));
- ? ?? ?? ?? ?? ?? ?? ?? ? $root = $aco->save ();
- ? ?? ?? ?? ?? ?? ?? ?? ? $root [' Aco '] [' id '] = $aco->id;
- ? ?? ?? ?? ?? ?? ?? ?? ? $log [] = ' Created Aco node for controllers ';
- ? ?? ?? ?? ?? ? } else {
- ? ?? ?? ?? ?? ?? ?? ?? ? $root = $root [0];
- ? ?? ?? ?? ?? ? }? ?
- ? ?? ?? ?? ?? ? App::import (' Core ', ' File ');
- ? ?? ?? ?? ?? ? $Controllers = configure::listobjects (' controller ');
- ? ?? ?? ?? ?? ? $appIndex = Array_search (' App ', $Controllers);
- ? ?? ?? ?? ?? ? if ($appIndex!== false) {
- ? ?? ?? ?? ?? ?? ?? ?? Unset ($Controllers [$appIndex]);
- ? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ? $baseMethods = Get_class_methods (' Controller ');
- ? ?? ?? ?? ?? ? $baseMethods [] = ' buildacl ';
- ? ?? ?? ?? ?? ? $Plugins = $this->_getplugincontrollernames ();
- ? ?? ?? ?? ?? ? $Controllers = Array_merge ($Controllers, $Plugins);
- ? ?? ?? ?? ?? ? Look at all controller in App/controllers
- ? ?? ?? ?? ?? ? foreach ($Controllers as $ctrlName) {
- ? ?? ?? ?? ?? ?? ?? ?? ? $methods = $this->_getclassmethods ($this->_getplugincontrollerpath ($ctrlName));
- ? ?? ?? ?? ?? ?? ?? ?? ?//Do all Plugins first
- ? ?? ?? ?? ?? ?? ?? ?? ? if ($this->_isplugin ($ctrlName)) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $pluginNode = $aco->node (' controllers/'. $this->_getpluginname ($ctrlName));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? if (! $pluginNode) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $aco->create (' parent_id ' + $root [' aco '] [' id '], ' model ' = null, ' Alias ' + $this->_getpluginname ($ctrlName)));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $pluginNode = $aco->save ();
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $pluginNode [' Aco '] [' id '] = $aco->id;
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $log [] = ' Created Aco node for '. $this->_getpluginname ($ctrlName). ' Plugin ';
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???}
- ? ?? ?? ?? ?? ?? ?? ?? ?}
- ? ?? ?? ?? ?? ?? ?? ?? ?//Find/make Controller node
- ? ?? ?? ?? ?? ?? ?? ?? ? $controllerNode = $aco->node (' controllers/'. $ctrlName);
- ? ?? ?? ?? ?? ?? ?? ?? ? if (! $controllerNode) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? if ($this->_isplugin ($ctrlName)) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $pluginNode = $aco->node (' controllers/'. $this->_getpluginname ($ctrlName));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $aco->create (' parent_id ' = ' $pluginNode [' 0 '] [' aco '] [' id '], ' model ' = null, ' Alias ' = $this->_ Getplugincontrollername ($ctrlName)));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $controllerNode = $aco->save ();
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $controllerNode [' Aco '] [' id '] = $aco->id;
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $log [] = ' Created Aco node for '. $this->_getplugincontrollername ($ctrlName). ' ' . $this->_getpluginname ($ctrlName). ' Plugin Controller ';
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???} else {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $aco->create (' parent_id ' + $root [' aco '] [' id '], ' model ' = null, ' Alias ' = $ctrlName));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $controllerNode = $aco->save ();
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $controllerNode [' Aco '] [' id '] = $aco->id;
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $log [] = ' Created Aco node for '. $ctrlName;
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???}
- ? ?? ?? ?? ?? ?? ?? ?? ?} else {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $controllerNode = $controllerNode [0];
- ? ?? ?? ?? ?? ?? ?? ?? ?}
- ? ?? ?? ?? ?? ?? ?? ?? ?//clean the methods. To remove those in Controller and private actions.
- ? ?? ?? ?? ?? ?? ?? ?? ? foreach ($methods as $k = = $method) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? if (Strpos ($method, ' _ ', 0) = = = 0) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? Unset ($methods [$k]);
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? Continue
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???}
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? if (In_array ($method, $baseMethods)) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? Unset ($methods [$k]);
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? Continue
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???}
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $methodNode = $aco->node (' controllers/'. $ctrlName. ' /'. $method);
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? if (! $methodNode) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $aco->create (' parent_id ' + $controllerNode [' aco '] [' id '], ' model ' = null, ' Alias ' = $method));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $methodNode = $aco->save ();
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $log [] = ' Created Aco node for '. $method;
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???}
- ? ?? ?? ?? ?? ?? ?? ?? ?}
- ? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ? if (count ($log) >0) {
- ? ?? ?? ?? ?? ?? ?? ?? ? debug ($log);
- ? ?? ?? ?? ?? ? }
- ? ?? ???}
- ? ?? ??? function _getclassmethods ($ctrlName = null) {
- ? ?? ?? ?? ?? ? App::import (' Controller ', $ctrlName);
- ? ?? ?? ?? ?? ? if (strlen (Strstr ($ctrlName, '. ')) > 0) {
- ? ?? ?? ?? ?? ?? ?? ?? ?//Plugin ' s controller
- ? ?? ?? ?? ?? ?? ?? ?? ? $num = Strpos ($ctrlName, '. ');
- ? ?? ?? ?? ?? ?? ?? ?? ? $ctrlName = substr ($ctrlName, $num + 1);
- ? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ? $ctrlclass = $ctrlName. ' Controller ';
- ? ?? ?? ?? ?? ? $methods = Get_class_methods ($ctrlclass);
- ? ?? ?? ?? ?? ? ADD Scaffold Defaults If scaffolds is being used
- ? ?? ?? ?? ?? ? $properties = Get_class_vars ($ctrlclass);
- ? ?? ?? ?? ?? ? if (array_key_exists (' scaffold ', $properties)) {
- ? ?? ?? ?? ?? ?? ?? ?? if ($properties [' scaffold '] = = ' admin ') {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $methods = Array_merge ($methods, Array (' Admin_add ', ' admin_edit ', ' admin_index ', ' admin_view ', ' admin_delete '));
- ? ?? ?? ?? ?? ?? ?? ?? ?} else {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $methods = Array_merge ($methods, Array (' Add ', ' edit ', ' index ', ' View ', ' delete '));
- ? ?? ?? ?? ?? ?? ?? ?? ?}
- ? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ? return $methods;
- ? ?? ???}
- ? ?? ??? function _isplugin ($ctrlName = null) {
- ? ?? ?? ?? ?? ? $arr = String::tokenize ($ctrlName, '/');
- ? ?? ?? ?? ?? ? if (count ($arr) > 1) {
- ? ?? ?? ?? ?? ?? ?? ?? ? return true;
- ? ?? ?? ?? ?? ? } else {
- ? ?? ?? ?? ?? ?? ?? ?? ? return false;
- ? ?? ?? ?? ?? ? }
- ? ?? ???}
- ? ?? ??? function _getplugincontrollerpath ($ctrlName = null) {
- ? ?? ?? ?? ?? ? $arr = String::tokenize ($ctrlName, '/');
- ? ?? ?? ?? ?? ? if (count ($arr) = = 2) {
- ? ?? ?? ?? ?? ?? ?? ?? return $arr [0]. '.' . $arr [1];
- ? ?? ?? ?? ?? ? } else {
- ? ?? ?? ?? ?? ?? ?? ?? return $arr [0];
- ? ?? ?? ?? ?? ? }
- ? ?? ???}
- ? ?? ??? function _getpluginname ($ctrlName = null) {
- ? ?? ?? ?? ?? ? $arr = String::tokenize ($ctrlName, '/');
- ? ?? ?? ?? ?? ? if (count ($arr) = = 2) {
- ? ?? ?? ?? ?? ?? ?? ?? return $arr [0];
- ? ?? ?? ?? ?? ? } else {
- ? ?? ?? ?? ?? ?? ?? ?? ? return false;
- ? ?? ?? ?? ?? ? }
- ? ?? ???}
- ? ?? ??? function _getplugincontrollername ($ctrlName = null) {
- ? ?? ?? ?? ?? ? $arr = String::tokenize ($ctrlName, '/');
- ? ?? ?? ?? ?? ? if (count ($arr) = = 2) {
- ? ?? ?? ?? ?? ?? ?? ?? return $arr [1];
- ? ?? ?? ?? ?? ? } else {
- ? ?? ?? ?? ?? ?? ?? ?? ? return false;
- ? ?? ?? ?? ?? ? }
- ? ?? ???}
- /**
- * Get the names of the plugin controllers ...
- *
- * This function would get an array of the plugin controller names, and
- * Also makes sure the controllers is available for us to get the
- * Method names by doing a app::import for each plugin controller.
- *
- * @return array of plugin names.
- *
- */
- ? ?? ??? function _getplugincontrollernames () {
- ? ?? ?? ?? ?? ? App::import (' Core ', ' File ', ' Folder ');
- ? ?? ?? ?? ?? ? $paths = Configure::getinstance ();
- ? ?? ?? ?? ?? ? $folder =& new Folder ();
- ? ?? ?? ?? ?? ? $folder->CD (APP. ' Plugins ');
- ? ?? ?? ?? ?? ? Get the list of plugins
- ? ?? ?? ?? ?? ? $Plugins = $folder->read ();
- ? ?? ?? ?? ?? ? $Plugins = $Plugins [0];
- ? ?? ?? ?? ?? ? $arr = Array ();
- ? ?? ?? ?? ?? ? Loop through the plugins
- ? ?? ?? ?? ?? ? foreach ($Plugins as $pluginName) {
- ? ?? ?? ?? ?? ?? ?? ?? ?//change directory to the plugin
- ? ?? ?? ?? ?? ?? ?? ?? ? $didCD = $folder->cd (APP. ' Plugins '. Ds. $pluginName. Ds. ' Controllers ');
- ? ?? ?? ?? ?? ?? ?? ?? ?//Get A list of the files that has a file name that ends
- ? ?? ?? ?? ?? ?? ?? ?? ?//With controller.php
- ? ?? ?? ?? ?? ?? ?? ?? ? $files = $folder->findrecursive ('. *_controller\.php ');
- ? ?? ?? ?? ?? ?? ?? ?? ?//Loop through the controllers we found in the plugins directory
- ? ?? ?? ?? ?? ?? ?? ?? ? foreach ($files as $fileName) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? Get the base file name
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $file = basename ($fileName);
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? Get the controller name
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? $file = Inflector::camelize (substr ($file, 0, strlen ($file)-strlen (' _controller.php '));
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? if (!preg_match ('/^ '). Inflector::humanize ($pluginName). ' app/', $file)) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? if (! App::import (' Controller ', $pluginName. '. $file)) {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? Debug (' Error importing '. $file. ' For plugin '. $pluginName);
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? } else {
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?//Now prepend the Plugin name ...
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?//This is required to allow us to fetch the method names.
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? $arr [] = Inflector::humanize ($pluginName). "/" . $file;
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???}
- ? ?? ?? ?? ?? ?? ?? ?? ?}
- ? ?? ?? ?? ?? ? }
- ? ?? ?? ?? ?? ? return $arr;
- ? ?? ???}
Add good later we open the browser to access just the method
Like my http://localhost/cakephp/users/build_acl.
After running the program will automatically add all controller action to the ACOs table, you can now open the ACOs table should see a lot of records, such as
Next should be doing our most exciting thing, is to achieve the authority control, because we are ready to work in the early stage, and ultimately we are in order to achieve control permissions
1.??? ??? First introduce the following syntax, allowing access to $this->acl->allow ($aroAlias, $acoAlias);
Access denied to $this->acl->deny ($aroAlias, $acoAlias);
You open the Aros_acos table to see, so far the table should still not be recorded
We can write an initialization function
I also put this piece of code in the user controller
- function Initdb () {
- ? ? $group =& $this->user->group;
- ? ? Allow admins to everything
- ? ? $group->id = 1;? ???
- ? ? $this->acl->allow ($group, ' controllers ');
- ? ? Allow managers to posts and widgets
- ? ? $group->id = 2;
- ? ? $this->acl->deny ($group, ' controllers ');
- ? ? $this->acl->allow ($group, ' controllers/posts ');
- ? ? $this->acl->allow ($group, ' controllers/widgets ');
- ? ? Allow users to only add and edit on posts and widgets
- ? ? $group->id = 3;
- ? ? $this->acl->deny ($group, ' controllers ');? ?? ???
- ? ? $this->acl->allow ($group, ' controllers/posts/add ');
- ? ? $this->acl->allow ($group, ' controllers/posts/edit ');? ?? ???
- ? ? $this->acl->allow ($group, ' controllers/widgets/add ');
- ? ? $this->acl->allow ($group, ' controllers/widgets/edit ');
- }
Next we access the action in the browser
This is the time when you should find a lot more records in your Aros_acos table, haha, this is the secret of the ACL.
Next you can use different groups of user name login access, you can also modify the code inside the Initdb to test, as for the actual work of how to use, it depends on your own, and finally wish everyone a happy work! Finally I put the document here, interested friends can download the ACL in the detailed description of cakephp. RAR
Reprinted from: Batterylaptops