Security Trim SPNavigationNode

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");
This entry was posted in SharePoint Shorts and tagged , . Bookmark the permalink.
0 0 votes
Article Rating
Subscribe
Notify of
guest

Solve the maths problem shown below before posting: *

0 Comments
Inline Feedbacks
View all comments