ASP.NET MVC: The right way to propagate query parameter through all ActionLinks

前端 未结 6 2306
礼貌的吻别
礼貌的吻别 2020-12-15 13:27

In my application, key query string parameter can be used to grant access to certain actions/views.
Now I want all ActionLinks and Forms to automatically in

6条回答
  •  忘掉有多难
    2020-12-15 14:06

    Having a querystring parameter that controls authorization is a bad idea IMHO. What's stopping me from adding this parameter to my url that didn't contain?

    The preferred way to implement authorization is to use roles (http://msdn.microsoft.com/en-us/library/system.web.security.roleprovider.aspx).

提交回复
热议问题