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

[Solved] how Menu can see the AuthorizeAttribute used on the GlobalFilters

1 Answer 58 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.
Alexandre Jobin
Top achievements
Rank 1
Alexandre Jobin asked on 17 Jun 2011, 03:43 PM
hi!

the Menu doesnt seems to see the AuthorizeAttribute that i register with the GlobalFilters in MVC3. All the menus are still there. If i explicitly put the AuthorizeAttribute on the Action method, the menu will react correctly by not rendering the menu associeted with the Action method.

But what if im setup like this:

  • Register AuthorizeAttribute to the GlobalFilters so ALL Controllers & Actions required to be Authentified by default
  • Use AllowAnonymousAttribute on Actions that don't need to be Authentified (the solution for this is there: http://dotnetrdr.blogspot.com/2011/05/securing-your-aspnet-mvc-3.html)

So how the Menu can see that the AuthorizeAttribute is registered with the GlobalFilters and recongnize my AllowAnonymousAttribute? Is there a way do to this?

thank you for the help!

alex

1 Answer, 1 is accepted

Sort by
0
Alexandre Jobin
Top achievements
Rank 1
answered on 13 Jul 2011, 08:56 PM
i think when the Menu check for the AuthorizeAttribute on the controller or the action method, it should also check for the global filters. Is it possible to add this to your next version?

alex
Tags
Menu
Asked by
Alexandre Jobin
Top achievements
Rank 1
Answers by
Alexandre Jobin
Top achievements
Rank 1
Share this question
or