All items show in menu even when roles are specified

Discussion in 'ASP .Net' started by Chicagoboy27, Dec 12, 2006.

  1. Chicagoboy27

    Chicagoboy27 Guest

    I have all the following site map ...

    <siteMapNode url="nothing.aspx" title="nothing" description="Home"
    roles="">
    <siteMapNode url="default.asp" title="Home" description="Home"
    roles="" />
    <siteMapNode url="test.aspx" title="test" description="test"
    roles="test" />
    <siteMapNode url="test2.aspx" title="test2" description="test"
    roles="test2" />
    </siteMapNode>


    Both test and test2 show up on the menu when i log in with a user that
    has only test as their role. The only way I can make test2 hide based
    on role is using the following:


    <siteMapNode url="nothing.aspx" title="nothing" description="Home"
    roles="">
    <siteMapNode url="default.asp" title="Home" description="Home"
    roles="" />
    <siteMapNode url="test.aspx" title="test1" description="test"
    roles="test" />
    <siteMapNode title="test2" description="test2">
    <siteMapNode url="test2.aspx" title="test2"
    description="test2"
    roles="test2" />
    </siteMapNode>

    I am using securityTrimmingEnabled="true" in my web.config. I am not
    sure how to make scenerio 1 work without having to add the extra node.

    Thanks for your help in advance
    Chicagoboy27, Dec 12, 2006
    #1
    1. Advertising

  2. Chicagoboy27

    Chicagoboy27 Guest

    I think I was able to figure it out

    added to web config
    <location path="test2.aspx">
    <system.web>
    <authorization>
    <allow users="test2" />
    <deny users="*" />
    </authorization>
    </system.web>
    </location>


    Chicagoboy27 wrote:
    > I have all the following site map ...
    >
    > <siteMapNode url="nothing.aspx" title="nothing" description="Home"
    > roles="">
    > <siteMapNode url="default.asp" title="Home" description="Home"
    > roles="" />
    > <siteMapNode url="test.aspx" title="test" description="test"
    > roles="test" />
    > <siteMapNode url="test2.aspx" title="test2" description="test"
    > roles="test2" />
    > </siteMapNode>
    >
    >
    > Both test and test2 show up on the menu when i log in with a user that
    > has only test as their role. The only way I can make test2 hide based
    > on role is using the following:
    >
    >
    > <siteMapNode url="nothing.aspx" title="nothing" description="Home"
    > roles="">
    > <siteMapNode url="default.asp" title="Home" description="Home"
    > roles="" />
    > <siteMapNode url="test.aspx" title="test1" description="test"
    > roles="test" />
    > <siteMapNode title="test2" description="test2">
    > <siteMapNode url="test2.aspx" title="test2"
    > description="test2"
    > roles="test2" />
    > </siteMapNode>
    >
    > I am using securityTrimmingEnabled="true" in my web.config. I am not
    > sure how to make scenerio 1 work without having to add the extra node.
    >
    > Thanks for your help in advance
    Chicagoboy27, Dec 12, 2006
    #2
    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. Bryan
    Replies:
    1
    Views:
    760
    Steven Cheng[MSFT]
    Mar 1, 2006
  2. Tina Li
    Replies:
    0
    Views:
    283
    Tina Li
    Sep 18, 2003
  3. Larry Bud
    Replies:
    13
    Views:
    7,631
    Larry Bud
    Jan 7, 2008
  4. beaudetious

    Hide Menu Items Based On Roles

    beaudetious, Jan 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    189
    sloan
    Jan 9, 2006
  5. Chuck P

    Menu items and Roles

    Chuck P, Mar 7, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    511
    Steven Cheng[MSFT]
    Mar 8, 2007
Loading...

Share This Page