Showing posts with label cust. Show all posts
Showing posts with label cust. Show all posts

Tuesday, March 13, 2012

Trouble with sitemap and roles in ASP2

Has anyone else had any trouble setting up a sitemap view to be
filtered by roles?

We've put a cust role provider in place, and we can verify that it's
only being called once for each connection, and is returning the
correct roles, but...

When we specify a role on the top sitemapnode that role seems to add to
the roles on lower level nodes, so we end up needing to put roles="*"
on the top node, but then regardless of which role we put against the
subnodes they're all visible - seemingly inheriting this from the top
one.

Examples

<sitemapnode>
...contents
</sitemapnode
Causes nothing to be displayed (since we have trimming on, and there is
no role listed)

<sitemapnode roles="*">
<sitemapnode roles="Users"/>
</sitemapnode
Causes the inner node to be seen regardless of whether the user
connecting has a Users role or not

Any help/suggestions would be welcomeI have the sitemap nodes working just fine...

Here's my sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="default.aspx" title="Home" description="Return to the home
page." roles="*">
<siteMapNode title="Admin" roles="Admin">
<siteMapNode url="~/Admin/Inventory.aspx" title="Inventory"
description="Add, edit, and delete inventory." roles="Admin" />
<siteMapNode url="~/Admin/AuctionManagement.aspx" title="Auction Management"
description="Create, edit, and assign inventory." roles="Admin" />
</siteMapNode>
</siteMapNode>
</siteMap
And here's the settings in web.config:

<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<roleManager enabled="true"/>
<authentication mode="Forms"/>
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear/>
<add name="MySqlMembershipProvider" connectionStringName="MyLocalSQLServer"
applicationName="MyAppName" type="System.Web.Security.SqlMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider" description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap"
securityTrimmingEnabled="true"/>
</providers>
</siteMap
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<chris.rust@.microfocus.com> wrote in message
news:1137072804.528827.224120@.g43g2000cwa.googlegr oups.com...
> Has anyone else had any trouble setting up a sitemap view to be
> filtered by roles?
> We've put a cust role provider in place, and we can verify that it's
> only being called once for each connection, and is returning the
> correct roles, but...
> When we specify a role on the top sitemapnode that role seems to add to
> the roles on lower level nodes, so we end up needing to put roles="*"
> on the top node, but then regardless of which role we put against the
> subnodes they're all visible - seemingly inheriting this from the top
> one.
> Examples
> <sitemapnode>
> ...contents
> </sitemapnode>
> Causes nothing to be displayed (since we have trimming on, and there is
> no role listed)
> <sitemapnode roles="*">
> <sitemapnode roles="Users"/>
> </sitemapnode>
> Causes the inner node to be seen regardless of whether the user
> connecting has a Users role or not
> Any help/suggestions would be welcome

Trouble with sitemap and roles in ASP2

Has anyone else had any trouble setting up a sitemap view to be
filtered by roles?
We've put a cust role provider in place, and we can verify that it's
only being called once for each connection, and is returning the
correct roles, but...
When we specify a role on the top sitemapnode that role seems to add to
the roles on lower level nodes, so we end up needing to put roles="*"
on the top node, but then regardless of which role we put against the
subnodes they're all visible - seemingly inheriting this from the top
one.
Examples
<sitemapnode>
...contents
</sitemapnode>
Causes nothing to be displayed (since we have trimming on, and there is
no role listed)
<sitemapnode roles="*">
<sitemapnode roles="Users"/>
</sitemapnode>
Causes the inner node to be seen regardless of whether the user
connecting has a Users role or not
Any help/suggestions would be welcomeI have the sitemap nodes working just fine...
Here's my sitemap file:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="default.aspx" title="Home" description="Return to the home
page." roles="*">
<siteMapNode title="Admin" roles="Admin">
<siteMapNode url="~/Admin/Inventory.aspx" title="Inventory"
description="Add, edit, and delete inventory." roles="Admin" />
<siteMapNode url="~/Admin/AuctionManagement.aspx" title="Auction Management"
description="Create, edit, and assign inventory." roles="Admin" />
</siteMapNode>
</siteMapNode>
</siteMap>
And here's the settings in web.config:
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<roleManager enabled="true"/>
<authentication mode="Forms"/>
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear/>
<add name="MySqlMembershipProvider" connectionStringName="MyLocalSQLServer"
applicationName="MyAppName" type="System.Web.Security.SqlMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider" description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap"
securityTrimmingEnabled="true"/>
</providers>
</siteMap>
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
<chris.rust@.microfocus.com> wrote in message
news:1137072804.528827.224120@.g43g2000cwa.googlegroups.com...
> Has anyone else had any trouble setting up a sitemap view to be
> filtered by roles?
> We've put a cust role provider in place, and we can verify that it's
> only being called once for each connection, and is returning the
> correct roles, but...
> When we specify a role on the top sitemapnode that role seems to add to
> the roles on lower level nodes, so we end up needing to put roles="*"
> on the top node, but then regardless of which role we put against the
> subnodes they're all visible - seemingly inheriting this from the top
> one.
> Examples
> <sitemapnode>
> ...contents
> </sitemapnode>
> Causes nothing to be displayed (since we have trimming on, and there is
> no role listed)
> <sitemapnode roles="*">
> <sitemapnode roles="Users"/>
> </sitemapnode>
> Causes the inner node to be seen regardless of whether the user
> connecting has a Users role or not
> Any help/suggestions would be welcome
>