/// <summary> /// Returns a <see cref="TreeNode"/> for the <see cref="IUmbracoEntity"/> and /// attaches some meta data to the node if the user doesn't have start node access to it when in dialog mode /// </summary> /// <param name="e"></param> /// <param name="parentId"></param> /// <param name="queryStrings"></param> /// <returns></returns> internal TreeNode GetSingleTreeNodeWithAccessCheck(IUmbracoEntity e, string parentId, FormDataCollection queryStrings, int[] startNodeIds, string[] startNodePaths, bool ignoreUserStartNodes) { bool hasPathAccess; var entityIsAncestorOfStartNodes = UserExtensions.IsInBranchOfStartNode(e.Path, startNodeIds, startNodePaths, out hasPathAccess); if (ignoreUserStartNodes == false && entityIsAncestorOfStartNodes == false) { return(null); } var treeNode = GetSingleTreeNode(e, parentId, queryStrings); if (treeNode == null) { //this means that the user has NO access to this node via permissions! They at least need to have browse permissions to see //the node so we need to return null; return(null); } if (ignoreUserStartNodes == false && hasPathAccess == false) { treeNode.AdditionalData["noAccess"] = true; } return(treeNode); }