SharePoint Short #3
To have the URL specified by a SPNavigationNode security trimmed, make sure you do not specify the isExternal constructor parameter.
Obviously, specifying true for this parameter would not apply security trimming against the link, as you would be adding an external link. Specifying false, you’d think it would. Think again.
Using the two parameter constructor does apply security trimming, where relevant.
So, instead of
SPNavigationNode newNavNode = new SPNavigationNode("Node name", "http://someurl/library/page.aspx", false); |
do
SPNavigationNode newNavNode = new SPNavigationNode("Node name", "http://someurl/library/page.aspx"); |