private SiteMapNode ReturnNodeIfAccessible(SiteMapNode node)
 {
     if (node != null && node.IsAccessibleToUser(HttpContext.Current))
     {
         return node;
     }
     return null;
 }
 internal SiteMapNode ReturnNodeIfAccessible(SiteMapNode node)
 {
     if ((node != null) && node.IsAccessibleToUser(HttpContext.Current))
     {
         return(node);
     }
     return(null);
 }
示例#3
0
 internal static SiteMapNode ReturnNodeIfAccessible(SiteMapNode node)
 {
     if (node.IsAccessibleToUser(HttpContext.Current))
     {
         return(node);
     }
     else
     {
         throw new InvalidOperationException();                  /* need
                                                                  * a
                                                                  * message
                                                                  * here */
     }
 }
示例#4
0
        public override System.Web.SiteMapNodeCollection GetChildNodes(System.Web.SiteMapNode node)
        {
            System.Web.SiteMapNodeCollection children = new System.Web.SiteMapNodeCollection();

            IPublishable<Guid> item = _nodes[new Guid(node.Key)];

            // We shouldn't show page's child pages, just section's child pages.
            if (item is Section)
            {
                Section s = (Section)item;

                foreach (Section child in s.Childs)
                {
                    if (!_nodes.ContainsKey(child.ID))
                        _nodes.Add(child.ID, child);

                    SiteMapNode nodewrapper = new SiteMapNode(this, child);

                    if (HttpContext.Current.User.IsInRole("Administrator") || (nodewrapper.IsAccessibleToUser(HttpContext.Current) && child.IsVisible))
                        children.Add(nodewrapper);
                }

                foreach (Page child in s.Pages)
                {
                    if (!_nodes.ContainsKey(child.ID))
                        _nodes.Add(child.ID, child);

                    SiteMapNode nodewrapper = new SiteMapNode(this, child);

                    if (HttpContext.Current.User.IsInRole("Administrator") || (nodewrapper.IsAccessibleToUser(HttpContext.Current) && child.IsVisible))
                        children.Add(nodewrapper);
                }
            }

            return children;
        }
        protected SiteMapNode ReturnNodeIfAccessibleEx(SiteMapNode node)
        {
            var ctx = HttpContext.Current;

            return(ctx != null && node != null && node.IsAccessibleToUser(ctx) ? node : null);
        }
		internal static SiteMapNode ReturnNodeIfAccessible (SiteMapNode node)
		{
			if (node.IsAccessibleToUser (HttpContext.Current))
				return node;
			else
				throw new InvalidOperationException (); /* need
									 * a
									 * message
									 * here */
		}