Port 7.7 - WIP

This commit is contained in:
Stephan
2017-09-19 15:51:47 +02:00
parent d54658009c
commit 9ed6576908
126 changed files with 3447 additions and 596 deletions

View File

@@ -35,20 +35,7 @@ namespace Umbraco.Web.Trees
public class ContentTreeController : ContentTreeControllerBase, ISearchableTree
{
private readonly UmbracoTreeSearcher _treeSearcher = new UmbracoTreeSearcher();
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var node = base.CreateRootNode(queryStrings);
// if the user's start node is not default, then ensure the root doesn't have a menu
if (UserStartNodes.Contains(Constants.System.Root) == false)
{
node.MenuUrl = "";
}
node.Name = Services.TextService.Localize("sections/"+ Constants.Trees.Content);
return node;
}
protected override int RecycleBinId => Constants.System.RecycleBinContent;
protected override bool RecycleBinSmells => Services.ContentService.RecycleBinSmells();
@@ -112,9 +99,12 @@ namespace Umbraco.Web.Trees
{
var menu = new MenuItemCollection();
// if the user's start node is not the root then ensure the root menu is empty/doesn't exist
// if the user's start node is not the root then the only menu item to display is refresh
if (UserStartNodes.Contains(Constants.System.Root) == false)
{
menu.Items.Add<RefreshNode, ActionRefresh>(
Services.TextService.Localize(string.Concat("actions/", ActionRefresh.Instance.Alias)),
true);
return menu;
}
@@ -158,6 +148,16 @@ namespace Umbraco.Web.Trees
throw new HttpResponseException(HttpStatusCode.NotFound);
}
//if the user has no path access for this node, all they can do is refresh
if (Security.CurrentUser.HasPathAccess(item, Services.EntityService, RecycleBinId) == false)
{
var menu = new MenuItemCollection();
menu.Items.Add<RefreshNode, ActionRefresh>(
Services.TextService.Localize(string.Concat("actions/", ActionRefresh.Instance.Alias)),
true);
return menu;
}
var nodeMenu = GetAllNodeMenuItems(item);
var allowedMenuItems = GetAllowedUserMenuItemsForNode(item);
@@ -193,14 +193,7 @@ namespace Umbraco.Web.Trees
protected override bool HasPathAccess(string id, FormDataCollection queryStrings)
{
var entity = GetEntityFromId(id);
if (entity == null)
return false;
var content = Services.ContentService.GetById(entity.Id);
if (content == null)
return false;
return Security.CurrentUser.HasPathAccess(content, Services.EntityService);
return HasPathAccess(entity, queryStrings);
}
/// <summary>