This is a migrated thread and some comments may be shown as answers.

Menu security trimming with areas having same controller names

8 Answers 121 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Henry
Top achievements
Rank 1
Henry asked on 13 Jan 2015, 12:04 PM
Hi,

I've noticed that security trimming doesn't work when there's another controller with the same name in another area. We have one extra area currently in use, named "Mobile".

We correctly have the namespaces set up for each route, so the actions work fine otherwise between areas. For example our default route looks like this:

routes.MapRoute(     
                "Default",
                "{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                new[] { "MvcApp.Controllers" } //namespace
            );

Example menu:

@(Html.Kendo().Menu()
    .Name("menu")
    .Items(menu => {
        menu.Add().Text("About").Action("About", "Home", new { area = "" });
    }))

Security trimming won't work, unless our Mobile area's HomeController also has that same action (About()). If it's not there, authorize attribute won't work for the menu.

8 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 14 Jan 2015, 11:03 PM
Hello Henry,

The described problem is not a known issue. Could you provide more details about your current site structure - controllers/actions/areas? You can try to modify this code library in order to replicate the issue.
Observing the erroneous behavior locally will help us to narrow the problem down much faster and follow you up with more details.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Henry
Top achievements
Rank 1
answered on 15 Jan 2015, 07:30 AM
Hi Georgi,

I was able to reproduce this issue by making changes to the sample project in this older thread: http://www.telerik.com/forums/menu-does-not-work-with-areas

I added empty HomeController to "MyArea", and then changed the menu to:

@(Html.Kendo().Menu()
 .Name("menu")
 .Items(menu => {
  menu.Add().Text("About").Action("About", "Home", new { area = "" });
}))

Then I decorated the "root" area's About action with [Authorize(Roles = "Admin")].

Security trimming will only work if I then add About action to "MyArea" as well.

To support duplicate controller names, I added the namespace setting to route:

routes.MapRoute(
                "Default",
                "{controller}/{action}/{id}",
                new {controller = "Home", action = "Index", id = UrlParameter.Optional},
                new[] {"MvcApplication4.Controllers"}
                );

0
Georgi Krustev
Telerik team
answered on 19 Jan 2015, 08:40 AM
Hello Henry,

Thank you for the repro steps. I was able to observe the depicted issue. We will further investigate the case and will try to address the problem for the next service pack of Kendo UI due within a month.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Henry
Top achievements
Rank 1
answered on 13 Apr 2015, 11:06 AM

Hi,

 I was browsing through the release notes in recent versions, and couldn't find this issue mentioned.

 Has this been fixed in current version?

 Thanks...

0
Georgi Krustev
Telerik team
answered on 15 Apr 2015, 06:57 AM
Hello Henry,

I am afraid that we postponed the fix for later Kendo UI release, as there are tasks/bugs with higher priority. The fix is scheduled for Q2 2015 release, but I cannot guarantee whether it will be fixed or not. 

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Henry
Top achievements
Rank 1
answered on 27 Jul 2015, 11:19 AM

Hi,

any news on the fix? I didn't see it mentioned in Q2 release notes.

Thanks again...

0
Georgi Krustev
Telerik team
answered on 29 Jul 2015, 07:55 AM
Hello Henry,

I am afraid that the issue is still not scheduled for implementation. For your convenience, I will post an update here once the issue is fixed.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Georgi Krustev
Telerik team
answered on 22 Nov 2016, 08:29 AM
Hi,

I moved the issue in our public issue tracker:

https://github.com/telerik/kendo-ui-core/issues/2468

You can follow the progress of the issue there.

Regards,
Georgi Krustev
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Menu
Asked by
Henry
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Henry
Top achievements
Rank 1
Share this question
or