Completed
Last Updated: 13 Nov 2023 13:17 by ADMIN
Release R1.2024-Increment.1(15.Nov.2023)
Softwarehouse
Created on: 09 Mar 2023 07:33
Category: Menu
Type: Bug Report
0
When SecutiryTrimming is enabled adding the [Authorize] attribute to a controller does not hide it's action methods

Bug report

Adding the [Authorize] attribute to a controller does not hide the action methods when SecurityTrimming is enabled.

Reproduction of the problem

  1. Create an application with authorization and add an [Authorize] attribute to a controller:
    [Authorize]
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }

        public IActionResult About()
        {
            return View();
        }
  1. Add a Menu
        @(Html.Kendo().Menu()
          .Name("menu")
          .SecurityTrimming(st=>{
              st.Enabled(true);
          })
          .Items(i=>{
              i.Add().Action("Index", "Home").Text("Index");
              i.Add().Action("About", "Home").Text("About");
          })
          )

Current behavior

The Index and About menu items will not be hidden.

Expected/desired behavior

The Index and About menu items should be hidden when the [Authorize] attribute is added to the controller.

Environment

  • Kendo UI version: 2023.1.117
  • Browser: [all]
0 comments