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

[Solved] Sitemap Binding and Authorization Filter Across Areas

3 Answers 36 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 06 Jul 2011, 04:37 PM
It seems the Telerik Menu does not recognize the Authorization filter when inside other areas.

I am using sitemap binding to build my menu. 

Inside my "Samples" Area I've decorated an actionmethod with the authorize filter.  While navigating to different pages within that same area the menuitem is not visible.  However as soon as I navigate to a page which has an actionmethod in a different area then "Samples", the menuitem appears even though it should'nt.

Has anybody seen this problem or know how to fix it?

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 07 Jul 2011, 08:45 AM
Hello Jim,

 
This is not a known issue. Could you please send us the test case? Thus I will be able to review it locally and advice you further.

Kind regards,
Georgi Krustev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Jim
Top achievements
Rank 1
answered on 12 Jul 2011, 04:44 PM
Georgi,

Thanks for your reply.

I've attached a sample solution where I am seeing this issue. 

The web.sitemap file has three items.  "View1" is decorated with the Authorize filter in the controller.  When the application first loads "View1" is hidden.  If you click on "SampleHomeIndex",  "View1" appears even though is is decorated with the Authorize Filter.  If you click on "HomeIndex", "View1" is hidden as expected.

Can you help me figure it out?

Thanks,
Jim
0
Georgi Krustev
Telerik team
answered on 14 Jul 2011, 10:02 AM
Hello Jim,

 
Thank you for getting back to us and for the test project.

You are absolutely correct.

Menu, as other navigational component, uses namespace retrieved from RequestContext and the ControllerName to check whether the Action methods are allowed or not. In the case where Areas are used, the menu does not know for Controllers outside of the current namespace, thus it cannot check whether the requested Actions are allowed or not. That is why, when request Sample/Home/Index URL, Home/View1 is shown.

Unfortunately, we cannot provide proper solution of this issue. In order to achieve your goal, you will need to show/hide MenuItems by yourself. 

Kind regards,
Georgi Krustev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Menu
Asked by
Jim
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jim
Top achievements
Rank 1
Share this question
or