cannot hide link in sitemap using roles= ...

Discussion in 'ASP .Net' started by Chris, Jun 19, 2007.

  1. Chris

    Chris Guest

    Hi,

    i have a problem with the visibility of my sitemap.
    There is one role defined: "manager"
    There are two users: 'user1' (member of role manager) and 'user2' (not
    member).
    The login.aspx redirects to a page with a menu control associated to a
    SiteMapDataSource.

    I want to hide pg1 for all non-members of role manager (=user2).

    I did this in:

    web.sitemap:
    ------------
    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="page1.aspx" title="pg1" roles="manager" >
    <siteMapNode url="page2.aspx" title="pg2" >
    </siteMapNode>
    <siteMapNode url="page3.aspx" title="pg3" >
    </siteMapNode>
    </siteMapNode>
    </siteMap>

    in web.config:
    ------------
    <roleManager enabled="true" />

    <siteMap defaultProvider="AspXmlSiteMapProvider" enabled="true">
    <providers>
    <clear/>
    <add name="AspXmlSiteMapProvider"
    type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
    </providers>
    </siteMap>

    My problem: when logging with any user, that user (user2) sees all the
    pages, included pg1.

    How to make pg1 invisible for user2 using this sitemap?
    Thanks
    Chris
     
    Chris, Jun 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aa

    web.sitemap and roles

    aa, Dec 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    13,441
    Patrick Olurotimi Ige
    Dec 10, 2004
  2. Replies:
    1
    Views:
    7,708
    S. Justin Gengo [MCP]
    Jan 12, 2006
  3. =?Utf-8?B?RGVtZXRyaQ==?=

    Membership, Roles, & SiteMap

    =?Utf-8?B?RGVtZXRyaQ==?=, May 31, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,091
    =?Utf-8?B?RGVtZXRyaQ==?=
    May 31, 2006
  4. AmitKu
    Replies:
    1
    Views:
    812
    Cowboy \(Gregory A. Beamer\)
    Sep 27, 2006
  5. Learner
    Replies:
    5
    Views:
    278
    Dominick Baier [DevelopMentor]
    May 7, 2006
Loading...

Share This Page