Welcome Guest, Not a member yet? Register   Sign In
ACL is an Access Comtrol List
#1

[eluser]BigJoe[/eluser]
I'm not sure if I posted this in the right place, any way. I wanted to see if any one didn't have an idea on this. I just setup and created a web site using CI and I didn't see any thing related to this. So I'm confused sense I was told that it did have this option.


I'm looking for a way to setup roles and permissions. Then I add permissions to each role and then I assign each user a role with permissions and I don't see an option for this.

The idea is that a user could or can have more then one Role. and each role has permissions for that role. Giving the user permissions for area's and parts of the web site.

The roles and permissions are saved to a database. and then can be called when needed.

1. Setup the permissions 1st.
2. Add Roles and set the permissions for each role.
3. Add roles to users account.
3a. New users default settings. When a user registers for the 1st time.

Any one have any ideas on now to do some thing like this. Or an idea on how to add some thing like this.

Joe



#2

[eluser]InsiteFX[/eluser]
Search ACL in Ignited Code and the WIKI
#3

[eluser]BigJoe[/eluser]
[quote author="InsiteFX" date="1331947236"]Search ACL in Ignited Code and the WIKI
[/quote]

Thank you, That's what I was looking for. It's just do you know of some sample data that I can use for this. I left a comment about that. I all so tried it. and well I guess there's a class called 'user'. Have any idea where I can get this class from.

Thanks again
Joe
#4

[eluser]InsiteFX[/eluser]
Most users create their own users, what you want is an auth system which will have everything you need in it.
#5

[eluser]Predator[/eluser]
I was looking for the same. And I found this -> http://www.tastybytes.net/blog/simple-ac...odeigniter

Seems very interesting approach(specially the one in the comment below), I HAVEN'T tried it yet, but I am going to do it tonight.
#6

[eluser]BigJoe[/eluser]
[quote author="Predator" date="1331989700"]I was looking for the same. And I found this -> http://www.tastybytes.net/blog/simple-ac...odeigniter

Seems very interesting approach(specially the one in the comment below), I HAVEN'T tried it yet, but I am going to do it tonight.
[/quote]

I wanted to see if you had any luck with this. Sense I didn't, I was hoping for some help on this.

The problem is that I need some sample data to add to the tables so I can test this and the other is that I don't under stand just what theses lines do.

Code:
$acl_test = $this->uri->segment(1).'_';
$acl_test .= ($this->uri->segment(2)!="")?$this->uri->segment(2):'view';

Can some one explain those lines to me so that I can under stand just what they do.



#7

[eluser]Noobigniter[/eluser]
This is a basic principle, I suggest you learn by example on this page: Ternary Operator but I will still tell you.

By concatenating the variable "$acl_test", we get this:

Code:
$acl_test = $this->uri->segment(1).'_'.(($this->uri->segment(2) != "") ? $this->uri->segment(2) : 'view');

Which means, if we admit that current url is: http://mywebsite.com/page/contact :

$this->uri->segment(1) is 'page' and $this->uri->segment(2) = 'contact'

Which gives

Code:
$acl_test = 'page_contact';

if we admit that current url is: http://mywebsite.com/blog

$this->uri->segment(1) is 'blog';

Given that there is no second url segment, $this->uri->segment(2) will be worth it : 'view'

Which gives

Code:
$acl_test = 'blog_view';

Quote:The [removed]expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.

VoilĂ .
#8

[eluser]BigJoe[/eluser]
Cool, Thank you. That explains that. Great. Now do you know when I can get some sample data for the ACL and do you know of where I mite be able to get a sample of how to setup a admin section to add, change and change roles and the user roles, permissions for the ACL.

Thank you for the above info.
#9

[eluser]Noobigniter[/eluser]
I'm sorry, but on this point, I'm not going to help you :/
#10

[eluser]BigJoe[/eluser]
[quote author="Noobigniter" date="1332135009"]I'm sorry, but on this point, I'm not going to help you :/[/quote]

Then why did you even bother to help in the 1st place. I guess CI is a trash too.




Theme © iAndrew 2016 - Forum software by © MyBB