Welcome Guest, Not a member yet? Register   Sign In
I really think it's time for me to learn a framework... but I've got a few questions
#6

[eluser]Rick Jolly[/eluser]
CI doesn't have an Authorization/ACL system, but if you are looking for a good one, you might want to check out the zend framework ACL. Using it with CI is straightforward - just remember to add it to your include path, then require() or include() it.

There are a few things that CI offers that could help simplify your code when using a complicated authorization system:
1) Break your views up into fragments.
What I mean is this: Every part of a view that requires authorization in order to see it or use it could be a seperate view fragment. That view fragment could be loaded by a library that examines the current user's role and decides whether or not to return the fragment for inclusion. An example might be a sidebar view fragement with links only meant for the "admin" role.
2) Use inheritance.
For example, if you have a back-end admin section with several controllers, you could extend an "admin" parent controller that validates the current user within its constructor. No need to do authorization checks everywhere.


Messages In This Thread
I really think it's time for me to learn a framework... but I've got a few questions - by El Forum - 08-10-2007, 12:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB