CakePHP 1.3    Plugin ACL    

ACL Plugin for CakePHP 1.3

The core of CakePHP contains a system to control access rights based on Access control list. This mechanism is very useful, but I have to admit, not very easy to dive in the first time you try to use it.

Moreover, CakePHP doesn't provide out of the box an interface to configure the rights managed through ACL.

This plugin is such an interface allowing to manage permissions of your application's users and roles.

Technically, it allows to manage the content of the aros, acos and aros_acos tables, used by the CakePHP ACL Component. Its interface is partially inspired by the one you can find in the Croogo CMS, and a part of the code comes from this tutorial of the CakePHP documentation.

 

 

Prerequisites

  • CakePHP 1.3.x

  • A website whose access rights are managed through the ACL Component. A good introduction on how to use this Component can be found in the CakePHP documentation.

  • a table in your database containing the users (its name can be configured)

  • a table in your database containing the roles (its name can be configured). The example given in the tutorial above uses for instance a table called groups and not roles.

Features

  • creation of acos for each action of your controllers

  • automatic detection of new controllers and/or actions

  • clear display of roles permissions

  • clear display of users specific permissions

  • easy edition of roles permissions (through AJAX)

  • easy edition of users specific permissions (through AJAX)

Demo

A sample application containing the ACL plugin can be found here. This sample application is volontary simple.

But please note that the users and roles pages are automatically generated through bake by using the templates of the Alaxos plugin.

Download

This plugin is available on the downloads page.

Installation

  • copy the folder acl in your folder /app/plugins

  • configure the admin route (see http://book.cakephp.org/view/950/Prefix-Routing)

  • copy the parameters found in acl/config/bootstrap.php in your file /app/config/bootstrap.php

  • access the plugin by navigating to /admin/acl

 

parameter explanation
acl.aro.role.model Name of the model representing the roles

Typically: "Role" ou "Group"
acl.aro.role.primary_key Allows to force the name of the roles primary key

Can be left empty if this name follows the CakePHP conventions ("id")
acl.aro.role.foreign_key Allows to force the name of the role foreign key

Can be left empty if this name follows the CakePHP conventions (e.g. "role_id")
acl.aro.user.model Name of the model representing the users

Typically: "User"
acl.aro.user.primary_key Allows to force the name of the users primary key

Can be left empty if this name follows the CakePHP conventions ("id")
acl.aro.role.display_field Name of the field used to display the roles

Typically: "name"
acl.role.access_plugin_role_ids An array containing the roles ids being in all cases allowed to access the plugin (by bypassing the ACL permissions).

Useful to not being denied access from the ACL plugin when we manipulate the ACL permissions.
acl.role.access_plugin_user_ids An array containing the users ids being in all cases allowed to access the plugin (by bypassing the ACL permissions).

Useful to not being denied access from the ACL plugin when we manipulate the ACL permissions.
acl.user.display_name The name of the field to use to display the users

It can also be a SQL expression such as:

CONCAT(User.lastname, ' ', User.firstname) for MySQL
acl.check_act_as_requester Indicates wether the presence of the ACL Behavior configured as Requester in the user and role models must be automatically verified when the plugin is accessed
acl.gui.roles_permissions.ajax Indicates wether the roles permissions page must be loaded through AJAX.

Depending on the number of permissions to check, this page may takes much time to load. To prevent a webserver timeout, it is possible to configure the page loading through AJAX.
acl.gui.users_permissions.ajax Indicates wether the users permissions page must be loaded through AJAX.

Depending on the number of permissions to check, this page may takes much time to load. To prevent a webserver timeout, it is possible to configure the page loading through AJAX.

FAQ

A list of FAQ is available here.

Looking for a CakePHP 2.0 version ?

Page created on : 2010-06-25 23:08:14 | last update : 2011-12-09 16:08:14

New comment

Your name
Your email
won't be displayed on the website
Your website
Your comment
  • URLs and email addresses surrounded by spaces are automatically activated
  • to include a block of code, surround it with [code]...[/code]

569 comments

<< newer | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9...28 | 29 |
comment by viagra on 2014-07-30 at 23:05:08 - www.viagrawithoutprescriptiona7buy.com/
comment by viagra on 2014-07-30 at 12:12:08 - 7freeviagra.com/
comment by free_cialis on 2014-07-30 at 12:11:29 - 7freecialis.com/
comment by cialis_price on 2014-07-30 at 12:11:13 - cialis7prices.com/
comment by cialis_price on 2014-07-29 at 23:48:25 - cialis7prices.com/
comment by cialis on 2014-07-29 at 21:52:14 - cialis7prices.com/
comment by viagra on 2014-07-29 at 21:32:03 - 7freeviagra.com/
comment by viagra on 2014-07-29 at 21:11:45 - 7freeviagra.com/
comment by cialis_price on 2014-07-29 at 21:04:45 - cialis7prices.com/
comment by generic_cialis on 2014-07-29 at 15:42:46 - canadiancialisb7pharm.com/
comment by generic_cialis on 2014-07-29 at 13:47:09 - www.cialisprofessionalb7pharm.com/
comment by cheapest on 2014-07-29 at 13:27:23 - www.cialisprofessionalb7pharm.com/
comment by free_viagra on 2014-07-29 at 13:07:26 - canadian7viagra.com/
comment by cheap_viagra on 2014-07-29 at 13:00:23 - inaugurationreport.com/
comment by viagra_samples on 2014-07-29 at 12:49:45 - www.viagraenglanda7pills.com/
comment by on on 2014-07-29 at 12:40:32 - www.viagraonlinemed7a.com/
comment by cialis_england on 2014-07-29 at 12:23:16 - www.cialisenglandonline7b.com/
comment by online on 2014-07-29 at 12:21:00 - www.viagraonlinemed7a.com/
comment by on on 2014-07-29 at 11:49:34 - www.viagraonlinemed7a.com/
comment by fast on 2014-07-29 at 04:23:31 - radiogranada.net/
<< previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9...28 | 29 |