// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System.Collections;
using System.Collections.Specialized;
using System.Text;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Resources;
+using System.Security.Principal;
namespace System.Web {
public class SiteMapNode : IHierarchyData, INavigateUIData, ICloneable {
}
public virtual bool HasChildNodes {
- get { return ChildNodes != null && ChildNodes.Count != 0; }
+ get {
+ SiteMapNodeCollection childNodes = ChildNodes;
+ return childNodes != null && childNodes.Count > 0;
+ }
}
public SiteMapNodeCollection GetAllNodes ()
}
}
- internal SiteMapNodeCollection ChildNodesInternal {
- get {
- if (childNodes == null)
- childNodes = new SiteMapNodeCollection ();
- return childNodes;
- }
- }
-
public virtual SiteMapNodeCollection ChildNodes {
get {
- if (childNodes != null) return childNodes;
- return provider.GetChildNodes (this);
+ if (provider.SecurityTrimmingEnabled) {
+ IPrincipal p = HttpContext.Current.User;
+ if ((user == null && user != p) || user != null && user != p) {
+ user = p;
+ childNodes = provider.GetChildNodes (this);
+ }
+ } else if (childNodes == null) {
+ childNodes = provider.GetChildNodes (this);
+ }
+ return childNodes;
}
set {
CheckWritable ();
+ user = null;
childNodes = value;
}
}
string resourceKey;
SiteMapNode parent;
SiteMapNodeCollection childNodes;
+ IPrincipal user;
#endregion
}
}
-#endif
+