PHP Classes

CodeIgniter ACL User Management: Manage the access of CodeIgniter users using ACL

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 354 All time: 6,965 This week: 71Up
Version License PHP version Categories
ci-acl 1.0.1MIT/X Consortium ...5PHP 5, User Management, Libraries


This class can manage the access of CodeIgniter users using ACL.

It takes a array of configuration of routes and the respective user access permissions.

The class can evaluate if the current user has access to the page given its current route.

Picture of Rogério Taques
Name: Rogério Taques <contact>
Classes: 4 packages by
Country: Japan Japan
Age: ???
All time rank: 237310 in Japan Japan
Week rank: 280 Up1 in Japan Japan Up


CI ACL 1.0 beta

Implements an Access Control List for your applications written with Codeigniter.

You should use it in order to help you control which path the user can (or cannot) access.

Getting Started

Download this project, and copy its content into your Codeigniter app, under `application` folder.

For example:

   / (project root directory)
   -- ...

After "instal" it on your app, then you'll need to setup all acl definitions.

All those definitions should be placed in ` ./applicaton/config/acl.php`, i.e:

$acl = array(


	'welcome/index' => array(

	'welcome/private_users' => array(
		'user'  => TRUE,
        'admin' => FALSE

	'welcome/private_admins' => array(
		'user'  => FALSE,
        'admin' => TRUE


Finally, in order to test if given path is valid or not, do as following:

    $ci =& get_instance();
    // check if given path isn't public
    if (! $ci->acl->is_public('path/to/test'))
        if (! $ci->acl->is_allowed('path/to/test', 'role-to-test'))
            // do your stuff here ...
            // i.e: set the error message and redirect to some page.

That's all.


There some methods that can be used on runtime:

is_public( path : string ) : boolean

Return TRUE when given path is set as 'public', otherwise, return FALSE.

is_allowed( path: string, role : string ) : boolean

Return TRUE when given role is set as 'true' for given path, otherwise, return FALSE.

set( path : string, config : array ) : void

This method is used to add new ACL rules that are not present on `config/acl` on runtime.

It's very useful when you're storing your ACL rules on database.


   $ci->acl->set( 'a/new/path/to/check', array( 'user' => FALSE, 'admin' => TRUE ) ); // or
   $ci->acl->set( 'a/new/path/to/check', array( 'public' ) );

Get involved

Report bugs, make suggestions and get involved on contributions.

Feel free to get in touch. ;)

  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imagelibraries (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file acl.php Aux. Auxiliary script

  Files folder image Files  /  libraries  
File Role Description
  Plain text file Acl.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,965
This week:71Up
User Comments (1)
I had to rate you for creating this package.
7 years ago (Johnny Mast)