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

[eluser]NachoF[/eluser]
[quote author="gh0st" date="1266364850"]The MY_Controller is an extension of the core. You can put repetitive stuff in there, and extend MY_Controller to do what you require.

The Admin_Controller is a controller which can be used for the admin sections; or things that require authorization.

If you want a products controller and admins to create stuff and then let users access a list;

I would put the listing in MY_Controller and admin stuff in Admin_Controller. The auth layer bit could be in MY_Controller, or if you only want it for Admin, put it in Admin_Controller.

Unfortuently there is a lot of code that is wrapped inside of Tank Auth and figuring out what should and should not be in the Admin_Controller can be time consuming.

I am hoping @Devon Lambert puts up some code to explain the seperation (or not) of the Tank auth layer with a modular setup.

I've got it set up so that my Admin_Controller extends yet another Controller called "Auth_Controller" where I put the tank auth layer itself where it does a very basic check to make sure you are logged in.[/quote]

Jesus, this just gets more and more complicated.... let me show you what Im used to so you can tell what I want.

This is an example of a class in asp.net mvc that enfornces authorization

Code:
public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        
        [Authorize]
        public ActionResult CompanySecrets()
        {
            return View();
        }


        [Authorize(Users="Stephen")]
        public ActionResult StephenSecrets()
        {
            return View();
        }


        [Authorize(Roles = "Administrators")]
        public ActionResult AdministratorSecrets()
        {
            return View();
        }

    }
}
http://www.asp.net/learn/mvc/tutorial-17-cs.aspx

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?


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