Members - Security Trimming the navigation... Options
jhildeman
Posted: Friday, October 05, 2007 3:22:54 PM

Rank: Enthusiast

Joined: 6/12/2007
Posts: 35
Location: Appleton, WI USA
Does anyone have any navigation-XSLT that includes a check to make sure this member has access to this node? Essentially, I want to "security trim" the navigation so it only shows the nodes this member has access to. Obviously, it has to work when no one is logged in as well.

Not sure how to tackle this one. Any help is greatly appreciated.

Thanks,
James
drobar
Posted: Friday, October 05, 2007 3:42:00 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Here's a snippet of how I do it in XSLTsearch...

Code:

    <xsl:variable name="possibleNodes" select="$items/descendant-or-self::node[
                                               string(data [@alias='umbracoNaviHide']) != '1'
                                               and (umbraco.library:IsProtected(@id, @path) = false()
                                                    or umbraco.library:HasAccess(@id, @path) = true())
                                               ]"/>


The important things you want to look for are the umbracoNaviHide property (a de-facto standard), and then if the node IsProtected() and, if so, if the current user HasAccess() to it.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.