0

在我的网站上,只有授权用户才能查看价目表。但是,匿名用户被拒绝访问网站的任何页面。我想不通。

4

1 回答 1

0

简而言之:在您的身份验证中配置不正确。一种解决方案是在返回价格视图的Controlleror之上设置 Authorize 属性。ActionResult

[Authorize(Roles="CanAccessPriceList")]
public class AccountController : Controller

ActionResult级别代码,例如:

[AuthorizeUser(AccessLevels="ReadPrices, UpdatePrices")]
public ActionResult PriceList(int parameter)
{
   // some code...
   return View();
}
于 2013-01-20T03:37:27.733 回答