{"id":838,"date":"2012-02-22T21:37:08","date_gmt":"2012-02-22T21:37:08","guid":{"rendered":"http:\/\/www.stuartroberts.net\/?p=838"},"modified":"2012-02-24T09:29:11","modified_gmt":"2012-02-24T09:29:11","slug":"quick-tip-3","status":"publish","type":"post","link":"http:\/\/www.stuartroberts.net\/index.php\/2012\/02\/22\/quick-tip-3\/","title":{"rendered":"Security Trim SPNavigationNode"},"content":{"rendered":"<p><strong>SharePoint Short #3<\/strong><br \/>\nTo have the URL specified by a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.sharepoint.navigation.spnavigationnode.aspx\" title=\"SPNavigationNode\" target=\"_blank\">SPNavigationNode<\/a> security trimmed, make sure you do <strong>not<\/strong> specify the <em>isExternal<\/em> constructor parameter.<\/p>\n<p>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&#8217;d think it would.  Think again.<\/p>\n<p>Using the two parameter constructor does apply security trimming, where relevant.<\/p>\n<p>So, instead of<\/p>\n<pre lang='csharp'>\r\nSPNavigationNode newNavNode = new SPNavigationNode(\"Node name\",\r\n                                  \"http:\/\/someurl\/library\/page.aspx\", false);\r\n<\/pre>\n<p>do<\/p>\n<pre lang='csharp'>\r\nSPNavigationNode newNavNode = new SPNavigationNode(\"Node name\",\r\n                                  \"http:\/\/someurl\/library\/page.aspx\");\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"http:\/\/www.stuartroberts.net\/index.php\/2012\/02\/22\/quick-tip-3\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[44],"tags":[81,45],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/plx2I-dw","_links":{"self":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/838"}],"collection":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/comments?post=838"}],"version-history":[{"count":10,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/838\/revisions"}],"predecessor-version":[{"id":864,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/838\/revisions\/864"}],"wp:attachment":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/media?parent=838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/categories?post=838"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/tags?post=838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}