In my ASP.NET MVC 4 application, I am using the intranet template to implement Windows authentication. I am also using Fluent Security.
Out of the box I can use the annotations shown below to limit access to controller methods to either specific domain groups or domain users.
[Authorize(Roles=@"Domain\GroupName")]
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
return View();
}
[Authorize(Users=@"Domain\UserName")]
public ActionResult About()
{
ViewBag.Message = "Your app description page.";
return View();
}
How would I limit these two methods to the same domain group and domain user using Fluent Security? I'm more interested in the group than the user if that is any easier. Do I need to build a custom policy? If so, I'm not quite sure how to check if the authenticated user is in a domain group to return the proper role for Fluent Security to use?
I have already gone through the FluentSecurity getting started so I do know the basics of how to implement FluentSecurity, I'm just not sure how to use Domain Groups as roles.
Thanks!