Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Maton 387 posts 659 karma points
    Sep 02, 2009 @ 17:48
    Tom Maton
    0

    Getting pages available to specific roles

    Hi All,

    I am using an existng ASP.NET Membership & Roles for the members and have the login all working fine and can gain access to the secure area no problem.

    The problem I have is with the navigation as depending what group you are in depends on what links you can see in hte navigation.
    e.g.

    LoginPage
    ...page1 - roles: 1, 2, 3, 4
    ......page1a - roles: 1, 2
    ......page1b - roles: 3, 4
    ...page2 - roles: 3, 4
    ......page2a - roles: 3, 4
    ...page3 - roles: 3, 4
    ......page3a - roles: 4
    ......page3b - roles: 4
    ......page3c - roles: 4
    ......page3d - roles: 4
    ...page4 - roles: 1

    So I was wondering if there is something already within the Umbraco API which will allow me to get the roles assigned to the pages so I can build the navigation or to get a list of pages assigned to a role.

    Any help greatly appreciated

    Tom

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Sep 02, 2009 @ 17:54
    Dirk De Grave
    0

    Tom,

    the HasAccess() method in the umbraco.library class should do the trick here. It checks whether the current logged on user has access to the requested page.

    From c#, use intellisense to get the list of params, in xslt, use the insert value-of dialog, get the extension and select the method from the dropdown. it should list the params for that method as well.

    Cheers,

    /Dirk

  • Tom Maton 387 posts 659 karma points
    Sep 02, 2009 @ 18:10
    Tom Maton
    0

    Cheers Dirk,

    Just what I needed.

    Thanks

    Tom

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies