Welcome Guest, Not a member yet? Register   Sign In
Extending My_Controller with an Auth layer.
#17

[eluser]Devon Lambert[/eluser]
[quote author="NachoF" date="1266395557"]
Jesus, this just gets more and more complicated.... let me show you what Im used to so you can tell what I want.

...

So as you can see I want a simple one line of code to limit admins only for specific methods throughout ALL of my controllers in all of my app... is there a way? or somethng close?[/quote]

Hello Nacho,

If you take a look at the code I've provided you will find an extended_library which adds a method allowing you to determine if a user is an admin or not.

I've added Role_ID in to Tank Auth and thus I am able to pull a user's Role ID From the session like so:

Call this whenever you would like to confirm that a user is an admin.
Code:
$this->my_extended_auth->is_admin();

Hope it helps.


Messages In This Thread
Extending My_Controller with an Auth layer. - by El Forum - 02-01-2010, 07:20 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-01-2010, 07:56 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-01-2010, 09:18 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-01-2010, 11:49 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-01-2010, 04:42 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-02-2010, 03:35 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-02-2010, 05:26 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-02-2010, 05:42 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-15-2010, 11:47 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-15-2010, 03:28 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 02:40 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 03:12 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 10:05 AM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 12:00 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 04:02 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 08:32 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 08:46 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 09:00 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-16-2010, 09:22 PM
Extending My_Controller with an Auth layer. - by El Forum - 02-17-2010, 06:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB