forked from VahidN/DNTCommon.Web.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMvcActionsDiscoveryController.cs
More file actions
27 lines (22 loc) · 916 Bytes
/
Copy pathMvcActionsDiscoveryController.cs
File metadata and controls
27 lines (22 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Microsoft.AspNetCore.Mvc;
namespace DNTCommon.Web.Core.TestWebApp.Controllers;
public class MvcActionsDiscoveryController : Controller
{
private readonly IMvcActionsDiscoveryService _mvcActionsDiscoveryService;
public MvcActionsDiscoveryController(IMvcActionsDiscoveryService mvcActionsDiscoveryService)
{
_mvcActionsDiscoveryService = mvcActionsDiscoveryService;
}
public IActionResult Index()
{
//var securedControllerActions = _mvcActionsDiscoveryService.GetAllSecuredControllerActionsWithPolicy("DynamicPermission");
var controllerActions = _mvcActionsDiscoveryService.MvcControllers;
return View(controllerActions);
}
[AjaxOnly, HttpPost, ValidateAntiForgeryToken]
[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Index(string[] actionIds)
{
return Json(actionIds);
}
}