Not logged in - Login
< back

MvcSiteMapProvider Roles

In this case "Admin" is the authorized user.

Add to web.config

<appSettings>
    <add key="MvcSiteMapProvider_SecurityTrimmingEnabled" value="true"/>
</appSettings>

Add //Add to (change in) module - MvcSiteMapProviderModule.cs


bool securityTrimmingEnabled = true;

In //In Controller (above the action you want to constrict)


[Authorize(Roles = "Admin")]

In//In Mvc.sitemap


<mvcSiteMapNode title="$resources:Common,AccountTitle" controller="Account" action="Index" roles="Admin"/>