0

How to manage role Assignment by action wise in MVC3, i.e. each role is assigned by a different Action in MVC3 in C#.net ?

Steve Czetty
  • 6,147
  • 9
  • 39
  • 48

1 Answers1

1

If you want to restrict access to given actions you could decorate them with the [Authorize] attribute and specify the roles that are allowed to access it:

[Authorize(Roles = "Admin")]
public ActionResult SomeAction()
{
    ...
}
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928