In my ASP.NET MVC 4 application, I use the intranet pattern to implement Windows authentication. I also use Fluent Security.
Out of the box, I can use the annotations below to restrict access to controller methods for 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 to limit these two methods to the same domain group and domain user using Fluent Security? I'm more interested in a group than a user, if it's easier. Do I need to create my own policy? If so, I'm not quite sure how to check if the authenticated user in the domain group is verified to return the correct role to use Fluent Security?
I’ve already completed FluentSecurity training, so I know the basics of implementing FluentSecurity, I'm just not sure how to use domain groups as roles.
Thanks!
asp.net-mvc fluent-security
Michael carrabine
source share