Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6032875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:24:01+00:00 2026-05-23T05:24:01+00:00

Here is the overview Create Memberships Create Roles Create Sitemap (modify to use roles=admin)

  • 0

Here is the overview

  1. Create Memberships
  2. Create Roles
  3. Create Sitemap (modify to use roles=”admin”)
  4. Create Menu and bind web.sitemap to the menu, using new datasource from the menu smart tag
  5. Modify web.config to enable securityTrimmingEnabled

It works like this. If I assign a role to the root node in sitemap, the menu is correcty hidden for all other roles except the roles it is assinged to.

If I use role in one of the submenu, it does not work. Does anyone has a clue why?

web.sitemap

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode roles="*"> <--------------- Roles Works here
  <siteMapNode title="Home" url="~/Default.aspx" roles="admin"></siteMapNode> <-------- But not here
<siteMapNode title="Videos" url="~/Tags.aspx" />
<siteMapNode title="Student" url="~/MemberList.aspx" roles="student"/>
<siteMapNode title="My Page" url="~/MyPage.aspx" />
<siteMapNode title="My Recent Views" url="~/RecentViews.aspx" />
<siteMapNode title="Upload a Video" url="~/Upload.aspx" />
  <siteMapNode title="Administer Users" url="~/AdministerUsers.aspx" roles="admin">
      <siteMapNode title="Creat user" url="createUser.aspx"></siteMapNode>
  </siteMapNode>
</siteMapNode>
</siteMap>

web.config file (modification)

<siteMap enabled="true">
    <providers>
        <clear/>
        <add siteMapFile="Web.sitemap" name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true"/>
    </providers>
</siteMap>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:24:02+00:00Added an answer on May 23, 2026 at 5:24 am

    You might want to check this link out: http://blogs.msdn.com/b/dannychen/archive/2006/03/16/553005.aspx. The security trimmings feature of ASP.Net is one of the most often misunderstood features.

    The basic idea is that security trimmings are applied through the <authorization> tag in web.config, not through the roles in the siteMap. The roles property in the sitemap can only widen security, not narrow it. So for example, here is how you would really apply the Student roles rule for ~/MemberList.aspx:

    <location path="~/MemberList.aspx">
      <system.web>
        <authorization>
          <allow roles="Student" />
          <deny users="*" />
        </authorization>
      </system.web>
    </location>
    

    This will not only make the link disappear from your menu, it will actually make the page impossible to visit by somebody not in the Student role, even if they type the url directly into the browser. Without the <authorization> tag, it will always be possible to type in the url directly and still see the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote an overview for new comments in an admin panel. My code if($res
Here is a quick overview of the controllers functionality in most of the application:
Please read here and here to get a quick overview of my problem and
I'm new here. Seems to be a great site. What are the most important
Overview: Using C#, I'm outputting a LINQ to SQL table of data into a
I'm using GAPI to try and create simple reports from our Google Analytics data.
Here is a overview of my code. User press a record button and it
Here's a quick overview of my problem. I've got a list with initial background
Here is an overview of my application: It is basically a cook book. The
Here's an overview of how my solution looks: Here's my PizzaSoftwareData class: namespace PizzaSoftware.Data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.