I'm building a sitemap with IPublishedContent. With DynamicNode you could dot something like this in Razor:
foreach (var node in startNode.Children
.Where("HasAccess")
.Where("!IsProtected")
)
{
I see that the UmbracoHelper has IsProtected and MemberHasAccess, but they need a path property and with DynamicNode you don't need that. What path should I use there because I'm just trying to create a sitemap where protected pages are excluded.
Very interesting, looks like you just use it like Umbraco.IsProtected(node.Id, node.Url);
It seems the path parameter could be a CSV of NodeIds, but I can't understand quite why it needs both parameters.
In DynamicNode, the IsProtected methods calls umbraco.library.IsProtected(n.Id, n.Path) which now calls GetUmbracoHelper().IsProtected(DocumentId, Path), so it's actually just also now calling the UmbracoHelper.
IPublishedContent and HasAccess/IsProtected
Hello,
I'm building a sitemap with IPublishedContent. With DynamicNode you could dot something like this in Razor:
I see that the UmbracoHelper has IsProtected and MemberHasAccess, but they need a path property and with DynamicNode you don't need that. What path should I use there because I'm just trying to create a sitemap where protected pages are excluded.
Jeroen
Hi Jeroen,
Very interesting, looks like you just use it like Umbraco.IsProtected(node.Id, node.Url);
It seems the path parameter could be a CSV of NodeIds, but I can't understand quite why it needs both parameters.
In DynamicNode, the IsProtected methods calls umbraco.library.IsProtected(n.Id, n.Path) which now calls GetUmbracoHelper().IsProtected(DocumentId, Path), so it's actually just also now calling the UmbracoHelper.
Hope that's helpful?
Jeavon
Ah, I see, it should be @Umbraco.IsProtected(node.Id, node.Path)
is working on a reply...