【发布时间】:2015-09-06 16:22:12
【问题描述】:
我有一个将在内部使用的 Web 应用程序,它通过 Windows 身份验证进行身份验证。 <authentication mode="Windows" /> 在网络配置中
我有两个角色 - All 和 One - 可以访问应用程序中的不同页面:
[HttpGet]
public ActionResult Home()
{
return View();
}
[HttpGet]
[Authorize(Roles = "All")]
public ActionResult AllPage()
{
return View();
}
[HttpGet]
[Authorize(Roles = "All, One")]
public ActionResult OnePage()
{
return View();
}
理想情况下,每个人都可以看到主页,所有人都可以看到 AllPage 和 OnePage,一个人只能看到 OnePage 而不能看到 AllPage
我有两个用户,AllUser 和 OneUser,每个用户都在各自的组中。问题是,无论谁登录,一切都是未经授权的。授权永远不会成功。我已经在网上尝试了很多关于如何设置的教程,但都没有奏效。这真的不应该那么复杂,但我不能让它为我的生活工作。
我尝试过的事情:
Roles = "Domain\\All")如果有人对此有一些指导或帮助,我将不胜感激。
【问题讨论】:
标签: c# asp.net-mvc authorization windows-authentication roles