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.
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.
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.
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
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
Cheers Dirk,
Just what I needed.
Thanks
Tom
is working on a reply...