1

For example, I have this controller which implements the Authorize Atribute to requiere Login and be a member of Administrator Role. But I don´t know where to assign the roles to the different users. Can you help me to be more oriented? thanks!

    [Authorize(Roles = "Administrator")]
    public ActionResult Admin()
    {
        return View();
    }
Nacho
  • 21
  • 1
  • 1
    This is not a very good question. You could implement this a million different ways: [Microsoft Identity with Entity Framework and Sql Server for example](http://www.asp.net/identity) – Stephen P. Sep 28 '16 at 21:02
  • 1
    this article is for your solution https://code.msdn.microsoft.com/ASPNET-MVC-5-Security-And-44cbdb97 – Husni Salax Sep 28 '16 at 21:10
  • one of the way of doing it is assigning the roles in FormsAuthenticationTicket..Follow this for details...http://stackoverflow.com/questions/1385042/asp-net-mvc-forms-authentication-authorize-attribute-simple-roles – Nirav Parmar Sep 29 '16 at 00:39

0 Answers0