autoACL
Introduction
autoACL is Access Control Library for codeigniter. This library works with two methods.
1. User access control by role, e.g:
a) “admin/” is admin page that can be accessed only by admin.
b) “salary/” is employer’s salary page that can be edited by hrd dept and accounting dept.
2. User access control by Very Private Page (VPP) check, e.g:
a) “profile/edit/john.r” is a page to edit profile information that can be edited ONLY by user who logged on with username “john.r”.
Features
1. Restrict user based on role group.
2. Restrict user to access, edit or delete other user private page.
Advantages
1. No database needed. Work faster.
2. No need to modify controller. This library is autoloaded.
Set Up
1. Add autoacl to the autoload libraries to use it.
$autoload['libraries'] = array('autoacl');2. Copy folder config and libaries to application folder.
Demo
* If NOT Using Modular Separation (ME, HMVC, Matchbox, or others)
1. Copy profile.php and salary.php to your controllers.
2. Try to access all methods and see the message. e.g. http://localhost/yourbase-url/profile/edit/john; http://localhost/yourbase-url/profile/edit/15; http://localhost/yourbase-url/profile/view/john
* If USING Modular Separation (ME, HMVC, Matchbox, or others)
1. Copy test folder to your modules folder.
2. Try to access all methods and see the message. e.g. http://localhost/yourbase-url/test/profile/edit/john; http://localhost/yourbase-url/test/profile/edit/15; http://localhost/yourbase-url/test/profile/view/john
Download
The download also includes test module for test purpose. http://bitbucket.org/ardinotow/autoacl/
Copyright notes:
This work is modification from Wiredesignz & Maxximus’s MX_acl (http://ellislab.com/forums/viewthread/111916)