I am currently writing an Admin MVC 3 site, and each user has access only to certain parts of the site.
The areas of my site are the same as those of Role users, so I would like to do this to include the AuthorizeAttribute attribute in each area, using the name of the area as a parameter in the role.
So far, this has worked for me when I hard-coded the verification of each area, but I would just like to skip all areas and apply an authorization filter. (I use this as my own FilterProvider filter - http://www.dotnetcurry.com/ShowArticle.aspx?ID=578 )
My code so far ("Gcm" is one of my areas as well as role):
public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute());
Does anyone know how to get all areas of my application, so I can just scroll through them and not hardcode each area?
Or if someone has a better idea of ββhow to resolve for each area, that would be appreciated.
Thanks for your help Saan
source share