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

#1
[eluser]vukasin0[/eluser]
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:


Quote:https://www.dropbox.com/sh/ajy750jlito6dyc/GblTsK2g7X


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

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

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

--Autoload library (preferred way):
Quote:In: {CI_Root}/application/config/autoload.php
Code:
$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
Code:
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 !!!!

#2
[eluser]somenet[/eluser]
Please post the complete example or detail use of the library.

#3
[eluser]vukasin0[/eluser]
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.


Cheers
Vukasin

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

#5
[eluser]Unknown[/eluser]
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.

Thanks

#6
[eluser]vukasin0[/eluser]
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:
Code:
&lt;?php
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.

Cheers,
Vukasin

#7
[eluser]beardedlinuxgeek[/eluser]
Can you upload this to Github?

#8
[eluser]vukasin0[/eluser]
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.