A simple Role Based Access Control List that dosen’t require a database.
Users can have multiple roles, and roles have access permissions.
I’ve based this on the Drupal ACL which I very much like.
A configuration file called acl.php which needs to be stored in applications/config folder
A library file called acl.php which needs to stored in the applications/libraries folder
Inside the config file is the config array which has two arrays
$config[ ‘permission’ ] = array();
$config[ ‘roles’ ] = array();
To setup roles simply add role names, any names you like but you must have ‘admin’ as your main website owner/administrator
$config[ ‘roles’ ] = array( ‘user’, ‘blogger’, ‘editor’, ‘umpire’, ‘admin’ );
now set up the permission (which I tend to do on a controller basis);
$config[ 'permission' ] = array( 'users' => array( 'add' => array( 'admin' ), 'edit own'…
View original post 234 more words