Fluent Security – 配置参数化控制器操作
我做了很多研究并测试了FluentSecurity库的1.4和2.0版本,我似乎无法使用配置模式:
configuration.For(x => x.GetCustomer()) .RequireRole(appRoles);
当我的控制器动作需要一个参数,例如:
public ActionResult GetCustomer(int customerID)
目前是否支持此类配置? 如果是,如何针对具有必需参数的操作实施角色要求?
我在问同样的问题。 目前,您可以传递参数的默认值。
configuration .For(x => x.Index(default(string))) .DenyAnonymousAccess();
HomeController
是:
public ActionResult Index(string id) { return View(); }