Hello All,
I am using forms authentication against active directory and roles using azman. I am able to authenticate users and restrict access to folders based on a user's role. I have an asp:menu which is bound to the Web.sitemap, and I am trying to restrict menu options based on the active users role. When I add set securityTrimmingEnabled=true in my web.config and run the application, no menu options appear, which suggests that the sitemap control is not picking up the role of the current user.
Here are excerpts from my web.config
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true" ><providers>
<add name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
//////////////////////////////////////////////////////////////////////////////////////////////////////////
<roleManager
enabled="true"
cacheRolesInCookie="true"
defaultProvider="RoleManagerAzManADAMProvider"
cookieName=".ASPXROLES"
cookiePath="/"
cookieTimeout="30"
cookieRequireSSL="true"
cookieSlidingExpiration="true"
createPersistentCookie="false"cookieProtection="All"> <providers>
<
add name="RoleManagerAzManADAMProvider"
type="System.Web.Security.AuthorizationStoreRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, publicKeyToken=b03f5f7f11d50a3a"
connectionStringName="AzManADAMServer"applicationName="ePOS"/>
</
providers></roleManager>
//////////////////////////////////////////////////////////////////////////////////////////////////////////
<authorization>
<
deny users="?"/><allow users="*"/>
</
authorization>
//////////////////////////////////////////////////////////////////////////////////////////////////////////
Here is my sitemap
<?xml version="1.0" encoding="utf-8" ?>
<
siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" ><siteMapNode url="" title="Home" description=""> <siteMapNode url="~/FeedStatus/FeedStatus.aspx" title="Feed Status" description="" roles="Manager" />
<
siteMapNode url="~/Portfolios.aspx" title="Portfolios" description="" />
</siteMapNode>
//////////////////////////////////////////////////////////////////////////////////////////////////////////
So, if I login as a user with the "Manager" role, I would expect to see the Feed Status and Portfolios menu options, and if I login as an ordinary user, I would expect to see only the Portfolios menu option. In both cases, I don't see any menu options.
Pointers appreciated!