MVCSiteMap and Roles

Topics: General Topic
Jan 11, 2013 at 2:40 PM

I am using MVCSiteMap (https://github.com/maartenba/MvcSiteMapProvider) on my MVC3 web application for my menu navigation.  I am also using NetSqlAzman as roleprovider.

No matter what I try, the sitemap does not hide/show menu items based on roles.  For example, if you are logged in as an Editor, you can see Admin menu items when only Admin roles should see them.

Here are the relevant Web.config sections:

<roleManager defaultProvider="NetSqlAzManRoleProvider"
                 enabled="true"
                 cacheRolesInCookie="true"
                 cookieName=".ASPROLES"
                 cookieTimeout="50"
                 cookiePath="/"
                 cookieRequireSSL="false"
                 cookieSlidingExpiration="true"
                 cookieProtection="All">
      <providers>
        <clear />
        <add name="NetSqlAzManRoleProvider"
             type="NetSqlAzMan.Providers.NetSqlAzManRoleProvider"
             connectionStringName="NetSqlAzMan"
             storeName="MyStore"
             applicationName=MyApp"
             userLookupType="DB"
             defaultDomain=""
             UseWCFCacheService="False" />
      </providers>
    </roleManager>

Has anyone been able to get MVCSiteMap to work with NetSqlAzMan?  Any advice or help would be greatly appreciated.  I am at a complete loss on how to fix.

Coordinator
Jan 11, 2013 at 2:43 PM

Try to add securityTrimmingEnabled="true" to the siteMap tag into the web.config file.

Regards,
Andrea.

Jan 11, 2013 at 3:00 PM

 

It looks like that did the trick!

A million thanks Andrea!