Welcome Guest, Not a member yet? Register   Sign In
How to use ACL in CI?
#1

[eluser]Unknown[/eluser]
Hi everyone
I would like to ask about how to use ACL in CI. If someone know point to me how can i do that. If possible provide me some tutorial/example link.

ps: I'm newbie in CI
#2

[eluser]BigJoe[/eluser]
[quote author="PhilTem" date="1319878973"]I am currently writing my own implementation of an ACL which goes completely via permissions stored inside a database.

But first of all, I'd suggest you learned the basics of CI before you start with something as massive as an ACL so you only need to concentrate on the ACL and not on how to implement it in CI.

In short words my ACL-Library can manage resources, roles and per-role and per-user permissions, which is all user defined so completely detached from modules/controllers/methods etc.
By now the check for permissions works perfectly and the retrieving from permissions for the user's roles and all parent roles works fine. Yet a user can only be assigned to one specific role.
Per-user permissions are not yet implemented but are supposed to come.

Restricting access to a page (i.e. a (module/)controller/method combination) is easily realized by writing
Code:
$this->acl->restrict('admin.users.add', 'admin/users');
if e.g. you want to restrict access to users/roles allowed to access resource 'admin.users.add'. The second parameter defines the default redirect-url if the users has no permission.
You can also check if the user has permission to access a resource but don't want to redirect him
Code:
$this->acl->has_perm('admin.users.add');
I use this for my views where I add links dynamically by the rights the user has.

As soon as my ACL-Library or to be more precise my ACL-Module can be released in a stable version I'll probably drop it off here for a full contribution. So far the code runs stable but I can't tell if it's fast or slow or where to tweak the code. That's what I'm currently focusing on.

Or, if you want, I can drop you my ACL-Module via Mail. It runs kinda stable^^[/quote]

Thanks. I'm still looking for one that I can under stand. The one at the top with the link I don't under stand how to use it. It just needs more documents on this. I could really use one. That's easy to under stand. with some sample data too.

Joe




Theme © iAndrew 2016 - Forum software by © MyBB