Ensures that a user that has multiple start nodes cannot select the root start node in the tree dialogs

This commit is contained in:
Shannon
2017-09-06 12:54:32 +10:00
parent 8b17d69d32
commit 2efe2cc88a
4 changed files with 58 additions and 3 deletions

View File

@@ -54,6 +54,23 @@ namespace Umbraco.Web.Trees
}
#endregion
/// <summary>
/// Ensure the noAccess metadata is applied for the root node if in dialog mode and the user doesn't have path access to it
/// </summary>
/// <param name="queryStrings"></param>
/// <returns></returns>
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var node = base.CreateRootNode(queryStrings);
if (IsDialog(queryStrings) && UserStartNodes.Contains(Constants.System.Root) == false)
{
node.AdditionalData["noAccess"] = true;
}
return node;
}
protected abstract TreeNode GetSingleTreeNode(IUmbracoEntity e, string parentId, FormDataCollection queryStrings);