/// <summary> /// Checks all rules to determine if the current node should render in the sitemap. /// </summary> /// <param name="node">The node</param> /// <param name="context">The controller context</param> /// <returns><b>true</b> if the current node should be rendered; otherwise<b>false</b>.</returns> protected virtual bool ShouldNodeRender(ISiteMapNode node, ControllerContext context) { return(node.Clickable && node.IsVisible(SourceMetadata) && !node.HasExternalUrl(context.HttpContext) && string.IsNullOrEmpty(node.CanonicalUrl) && !node.HasNoIndexAndNoFollow && !this.IsDuplicateUrl(node)); }
/// <summary> /// Determines whether node is accessible to user. /// </summary> /// <param name="siteMap">The site map.</param> /// <param name="node">The node.</param> /// <returns> /// <c>true</c> if accessible to user; otherwise, <c>false</c>. /// </returns> public bool IsAccessibleToUser(ISiteMap siteMap, ISiteMapNode node) { // Not Clickable? Always accessible. if (!node.Clickable) return true; var httpContext = mvcContextFactory.CreateHttpContext(); // Is it an external Url? if (node.HasExternalUrl(httpContext)) return true; return this.VerifyNode(siteMap, node, httpContext); }
/// <summary> /// Determines whether node is accessible to user. /// </summary> /// <param name="siteMap">The site map.</param> /// <param name="node">The node.</param> /// <returns> /// <c>true</c> if accessible to user; otherwise, <c>false</c>. /// </returns> public bool IsAccessibleToUser(ISiteMap siteMap, ISiteMapNode node) { // Not Clickable? Always accessible. if (!node.Clickable) { return(true); } var httpContext = mvcContextFactory.CreateHttpContext(); // Is it an external Url? if (node.HasExternalUrl(httpContext)) { return(true); } return(this.VerifyNode(siteMap, node, httpContext)); }
/// <summary> /// Checks all rules to determine if the current node should render in the sitemap. /// </summary> /// <param name="node">The node</param> /// <param name="context">The controller context</param> /// <returns><b>true</b> if the current node should be rendered; otherwise<b>false</b>.</returns> protected virtual bool ShouldNodeRender(ISiteMapNode node, ControllerContext context) { return node.Clickable && node.IsVisible(SourceMetadata) && !node.HasExternalUrl(context.HttpContext) && string.IsNullOrEmpty(node.CanonicalUrl) && !node.HasNoIndexAndNoFollow && !this.IsDuplicateUrl(node); }