我做了很多研究并测试了 FluentSecurity 库的 1.4 和 2.0 版本,但我似乎无法使用配置模式:
configuration.For<MyController>(x => x.GetCustomer())
.RequireRole(appRoles);
当我的控制器操作需要一个参数时,例如:
public ActionResult GetCustomer(int customerID)
目前支持这种类型的配置吗?如果是这样,如何针对具有所需参数的操作实施角色要求?
我也在问同样的问题。目前,您可以传入参数的默认值。
configuration
.For<HomeController>(x => x.Index(default(string)))
.DenyAnonymousAccess();
where HomeController
is:
public ActionResult Index(string id)
{
return View();
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)