Using ASP.NET Identity you can easily set access to Controllers based on Roles.
You can use the "Authorize" for this.
You can use the "Authorize" for this.
Setting access to single Role:
[Authorize(Roles="Admin")]
Setting access to single Role:
[Authorize(Roles="Admin, User")]
Eg:
Its that simple. Happy coding... :)
[Authorize(Roles = "SuperAdmin", "Admin")] public ActionResult Register() { return View(); }
Its that simple. Happy coding... :)