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