• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Role based Access Control List (ACL)

Hi All,

I've created Role Based ACL Library to mach my project needing and want to share it with you.

I know that there is some ACLs available here but didn't find any ROLE Based (maybe I missed some Smile ).

Here you can find code and examples with sample data:


EC_ACL.sql - MySql DB Tables Prerequisite
mysql --user=root --password=password --database=test < EC_ACL.sql

EC_Acl.php - Library - put in your Application/Library folder

--Manually load library:
$this->load->library('EC_Acl'); // Moved to autoload

--Autoload library (preferred way):
Quote:In: {CI_Root}/application/config/autoload.php
$autoload['libraries'] = array('database', 'session', 'EC_Acl');

EC_ACL_login_controller_example.php - complete login and authentication process demo.
EC_ACL_get_object_access_example.php - provide roles access for objectid in user authenticated session demo.

EC_ACL_example_data_INSERT.sql - Sample data which should be used for demo
mysql --user=root --password=password --database=test < EC_ACL_example_data_INSERT.sql

ec_acl_demo.zip - this is ec_acl lib implemented in latest CI v2.1.2 framework. As prerequisite execute sample SQL and change configuration of {CI_Root}/application/config/database.php to match you DB.
To see results call acl_demo controller: http://localhost/acl_demo.

Any input / suggestion is very welcome !!!

At least I'm only hobbyist developer passioned in PHP and Open Source.

I don't want to spent many words about Codeigniter - great framework.

Cheers !!!!

Please post the complete example or detail use of the library.

Hi somenet,

I've updated lib for some details and add / extend examples in dropbox.

If you still need more info - plz let me know which one.


[eluser]Jason Hamilton-Mascioli[/eluser]
I will give it a look

i'm trying, but i'm found error

Quote:Fatal error: Class 'MY_Controller' not found

so, how to solve ?? please, give me your code for views.


Hi d4y4x,

MY_Controller is custom class to extend CI_Controller and contain all the time accessing methods I use in program.

Here is sample code:
if (!defined('BASEPATH'))
exit('No direct script access allowed');

class MY_Controller extends CI_Controller {

Thanks to point me to this - I'm going to create clean Codeigninter setup with this ACL in order to avoid situations like this one.


Can you upload this to Github?

Hi beardedlinuxgeek,

In meantime I did some modifications so definitely I'll move to some source control system GitHub or GoogleCode.

At the moment I'm short with time and expect that next week will be one to move/publish code.

Cheers !!!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.