我在 asp.net mvc5 中有以下操作方法,我将其定义为 ChildActionOnly:-
[ChildActionOnly]
public ActionResult GetChildRecords(int customerid)
在我看来,我将其称为如下:-
<div>@Html.Action("GetChildRecords", "Customer", new {customerid = Model.CustomerID})</div>
但我有以下问题:-
我需要在我的子操作方法之前添加 [Authorize] 注释吗?或者我可以肯定,因为它的父母被授权,所以子动作方法也将被授权?
用户或黑客可以直接调用 ChildActionOnly 吗?
用户或黑客可以修改 Html.Action 参数吗?例如在下面的 html 中传递不同的 customerid:-
@Html.Action("GetChildRecords", "Customer", new {customerid = Model.CustomerID})
?