コード例 #1
0
 private SiteMapNode ReturnNodeIfAccessible(SiteMapNode node)
 {
     if (node != null && node.IsAccessibleToUser(HttpContext.Current))
     {
         return node;
     }
     return null;
 }
コード例 #2
0
 internal SiteMapNode ReturnNodeIfAccessible(SiteMapNode node)
 {
     if ((node != null) && node.IsAccessibleToUser(HttpContext.Current))
     {
         return(node);
     }
     return(null);
 }
コード例 #3
0
ファイル: SiteMapProvider.cs プロジェクト: pmq20/mono_forked
 internal static SiteMapNode ReturnNodeIfAccessible(SiteMapNode node)
 {
     if (node.IsAccessibleToUser(HttpContext.Current))
     {
         return(node);
     }
     else
     {
         throw new InvalidOperationException();                  /* need
                                                                  * a
                                                                  * message
                                                                  * here */
     }
 }
コード例 #4
0
ファイル: SiteMapProvider.cs プロジェクト: kohku/codefactory
        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;
        }
コード例 #5
0
        protected SiteMapNode ReturnNodeIfAccessibleEx(SiteMapNode node)
        {
            var ctx = HttpContext.Current;

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