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

[eluser]NachoF[/eluser]
[quote author="Phil Sturgeon" date="1265054167"]I try to avoid doing this as it is not all that flexible (for me at least).

I create a Public_Controller and a Admin_Controller then you can just do something like:

Code:
class Admin_Controller extends MY_Controller
{
    function Admin_Controller()
    {
        parent::__construct();
        
        if(!$this->user_lib->check_role('admin'))
        {
            show_error('Shove off user');
        }

        // And other stuff...
    }
}
[/quote]

Could you please explain this??
whats in My_Controller? also, about Admin_Controller...are your restricted controllers supposed to inherit from Admin_Controller or from My_Controller?....
Say I have a Products Controller.... I want my admins to be able to "Create" products but I want my regular users to be able to access the "List" of controllers.... How would I go about doing that??.... I havent started my application yet, I have just downloaded CI and installed Datamapper ORM, thats it... but I want to start with a correct auth layer beforehand.


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