Files
Umbraco-CMS/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs

562 lines
24 KiB
C#
Raw Normal View History

2018-06-29 19:52:40 +02:00
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
using System.Globalization;
using Umbraco.Core.Models.Entities;
using System.Web.Http.ModelBinding;
using Umbraco.Web.Actions;
using Umbraco.Web.Composing;
using Umbraco.Core.Security;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence;
2018-06-29 19:52:40 +02:00
namespace Umbraco.Web.Trees
{
public abstract class ContentTreeControllerBase : TreeController
{
protected ContentTreeControllerBase(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
{
}
protected ContentTreeControllerBase()
{
}
2018-06-29 19:52:40 +02:00
#region Actions
/// <summary>
/// Gets an individual tree node
/// </summary>
/// <param name="id"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
public TreeNode GetTreeNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings)
2018-06-29 19:52:40 +02:00
{
int asInt;
Guid asGuid = Guid.Empty;
if (int.TryParse(id, out asInt) == false)
{
if (Guid.TryParse(id, out asGuid) == false)
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
}
}
2018-06-29 19:52:40 +02:00
var entity = asGuid == Guid.Empty
? Services.EntityService.Get(asInt, UmbracoObjectType)
: Services.EntityService.Get(asGuid, UmbracoObjectType);
if (entity == null)
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
}
var node = GetSingleTreeNode(entity, entity.ParentId.ToInvariantString(), queryStrings);
//add the tree alias to the node since it is standalone (has no root for which this normally belongs)
node.AdditionalData["treeAlias"] = TreeAlias;
return node;
}
#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);
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
if (IsDialog(queryStrings) && UserStartNodes.Contains(Constants.System.Root) == false && IgnoreUserStartNodes(queryStrings) == false)
2018-06-29 19:52:40 +02:00
{
node.AdditionalData["noAccess"] = true;
}
return node;
}
protected abstract TreeNode GetSingleTreeNode(IEntitySlim entity, string parentId, FormDataCollection queryStrings);
/// <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>
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
internal TreeNode GetSingleTreeNodeWithAccessCheck(IEntitySlim e, string parentId, FormDataCollection queryStrings,
int[] startNodeIds, string[] startNodePaths)
2018-06-29 19:52:40 +02:00
{
var entityIsAncestorOfStartNodes = ContentPermissionsHelper.IsInBranchOfStartNode(e.Path, startNodeIds, startNodePaths, out var hasPathAccess);
var ignoreUserStartNodes = IgnoreUserStartNodes(queryStrings);
if (ignoreUserStartNodes == false && entityIsAncestorOfStartNodes == false)
2018-06-29 19:52:40 +02:00
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 && !hasPathAccess)
2018-06-29 19:52:40 +02:00
{
treeNode.AdditionalData["noAccess"] = true;
}
return treeNode;
}
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
private void GetUserStartNodes(out int[] startNodeIds, out string[] startNodePaths)
{
switch (RecycleBinId)
{
case Constants.System.RecycleBinMedia:
startNodeIds = Security.CurrentUser.CalculateMediaStartNodeIds(Services.EntityService);
startNodePaths = Security.CurrentUser.GetMediaStartNodePaths(Services.EntityService);
break;
case Constants.System.RecycleBinContent:
startNodeIds = Security.CurrentUser.CalculateContentStartNodeIds(Services.EntityService);
startNodePaths = Security.CurrentUser.GetContentStartNodePaths(Services.EntityService);
break;
default:
throw new NotSupportedException("Path access is only determined on content or media");
}
}
2018-06-29 19:52:40 +02:00
/// <summary>
/// Returns the
/// </summary>
protected abstract int RecycleBinId { get; }
/// <summary>
/// Returns true if the recycle bin has items in it
/// </summary>
protected abstract bool RecycleBinSmells { get; }
/// <summary>
/// Returns the user's start node for this tree
/// </summary>
protected abstract int[] UserStartNodes { get; }
protected virtual TreeNodeCollection PerformGetTreeNodes(string id, FormDataCollection queryStrings)
{
var nodes = new TreeNodeCollection();
var rootIdString = Constants.System.RootString;
2018-06-29 19:52:40 +02:00
var hasAccessToRoot = UserStartNodes.Contains(Constants.System.Root);
var startNodeId = queryStrings.HasKey(TreeQueryStringParameters.StartNodeId)
? queryStrings.GetValue<string>(TreeQueryStringParameters.StartNodeId)
: string.Empty;
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
var ignoreUserStartNodes = IgnoreUserStartNodes(queryStrings);
2018-06-29 19:52:40 +02:00
if (string.IsNullOrEmpty(startNodeId) == false && startNodeId != "undefined" && startNodeId != rootIdString)
{
// request has been made to render from a specific, non-root, start node
id = startNodeId;
// ensure that the user has access to that node, otherwise return the empty tree nodes collection
// TODO: in the future we could return a validation statement so we can have some UI to notify the user they don't have access
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
if (ignoreUserStartNodes == false && HasPathAccess(id, queryStrings) == false)
2018-06-29 19:52:40 +02:00
{
Logger.Warn<ContentTreeControllerBase>("User {Username} does not have access to node with id {Id}", Security.CurrentUser.Username, id);
2018-06-29 19:52:40 +02:00
return nodes;
}
// if the tree is rendered...
// - in a dialog: render only the children of the specific start node, nothing to do
// - in a section: if the current user's start nodes do not contain the root node, we need
// to include these start nodes in the tree too, to provide some context - i.e. change
// start node back to root node, and then GetChildEntities method will take care of the rest.
if (IsDialog(queryStrings) == false && hasAccessToRoot == false)
id = rootIdString;
}
// get child entities - if id is root, but user's start nodes do not contain the
// root node, this returns the start nodes instead of root's children
var entities = GetChildEntities(id, queryStrings).ToList();
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
//get the current user start node/paths
GetUserStartNodes(out var userStartNodes, out var userStartNodePaths);
nodes.AddRange(entities.Select(x => GetSingleTreeNodeWithAccessCheck(x, id, queryStrings, userStartNodes, userStartNodePaths)).Where(x => x != null));
2018-06-29 19:52:40 +02:00
// if the user does not have access to the root node, what we have is the start nodes,
// but to provide some context we also need to add their topmost nodes when they are not
// topmost nodes themselves (level > 1).
if (id == rootIdString && hasAccessToRoot == false)
{
var topNodeIds = entities.Where(x => x.Level > 1).Select(GetTopNodeId).Where(x => x != 0).Distinct().ToArray();
if (topNodeIds.Length > 0)
{
var topNodes = Services.EntityService.GetAll(UmbracoObjectType, topNodeIds.ToArray());
nodes.AddRange(topNodes.Select(x => GetSingleTreeNodeWithAccessCheck(x, id, queryStrings, userStartNodes, userStartNodePaths)).Where(x => x != null));
2018-06-29 19:52:40 +02:00
}
}
return nodes;
}
private static readonly char[] Comma = { ',' };
private int GetTopNodeId(IUmbracoEntity entity)
{
int id;
var parts = entity.Path.Split(Comma, StringSplitOptions.RemoveEmptyEntries);
return parts.Length >= 2 && int.TryParse(parts[1], out id) ? id : 0;
}
protected abstract MenuItemCollection PerformGetMenuForNode(string id, FormDataCollection queryStrings);
protected abstract UmbracoObjectTypes UmbracoObjectType { get; }
protected virtual IEnumerable<IEntitySlim> GetChildEntities(string id, FormDataCollection queryStrings)
{
// try to parse id as an integer else use GetEntityFromId
// which will grok Guids, Udis, etc and let use obtain the id
if (!int.TryParse(id, out var entityId))
2018-06-29 19:52:40 +02:00
{
var entity = GetEntityFromId(id);
if (entity == null)
throw new HttpResponseException(HttpStatusCode.NotFound);
entityId = entity.Id;
}
var ignoreUserStartNodes = IgnoreUserStartNodes(queryStrings);
2018-06-29 19:52:40 +02:00
IEntitySlim[] result;
// if a request is made for the root node but user has no access to
// root node, return start nodes instead
if (!ignoreUserStartNodes && entityId == Constants.System.Root && UserStartNodes.Contains(Constants.System.Root) == false)
2018-06-29 19:52:40 +02:00
{
result = UserStartNodes.Length > 0
? Services.EntityService.GetAll(UmbracoObjectType, UserStartNodes).ToArray()
: Array.Empty<IEntitySlim>();
}
else
{
result = GetChildrenFromEntityService(entityId).ToArray();
2018-06-29 19:52:40 +02:00
}
return result;
}
2019-06-28 15:03:52 +10:00
private IEnumerable<IEntitySlim> GetChildrenFromEntityService(int entityId)
=> Services.EntityService.GetChildren(entityId, UmbracoObjectType).ToList();
Merge remote-tracking branch 'origin/dev-v7' into temp8 # Conflicts: # .github/README.md # build.bat # src/Umbraco.Core/Migrations/Expressions/Alter/Table/AlterTableBuilder.cs # src/Umbraco.Core/Migrations/Expressions/Create/Column/CreateColumnBuilder.cs # src/Umbraco.Core/Migrations/Expressions/Create/Index/CreateIndexBuilder.cs # src/Umbraco.Core/Migrations/Expressions/Create/Table/CreateTableBuilder.cs # src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs # src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs # src/Umbraco.Core/Persistence/Factories/MediaFactory.cs # src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Persistence/Repositories/UserRepository.cs # src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs # src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IMediaService.cs # src/Umbraco.Core/Services/MediaService.cs # src/Umbraco.Core/Services/NotificationService.cs # src/Umbraco.Web.UI.Client/bower.json # src/Umbraco.Web.UI.Client/src/common/directives/components/imaging/umbimagegravity.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtreeitem.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js # src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js # src/Umbraco.Web.UI.Client/src/less/main.less # src/Umbraco.Web.UI.Client/src/less/panel.less # src/Umbraco.Web.UI.Client/src/less/property-editors.less # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.html # src/Umbraco.Web.UI.Client/src/views/components/imaging/umb-image-gravity.html # src/Umbraco.Web.UI.Client/src/views/content/copy.html # src/Umbraco.Web.UI.Client/src/views/content/emptyrecyclebin.html # src/Umbraco.Web.UI.Client/src/views/content/move.html # src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html # src/Umbraco.Web.UI.Client/src/views/datatypes/move.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.controller.js # src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.html # src/Umbraco.Web.UI.Client/src/views/media/move.html # src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html # src/Umbraco.Web.UI.Client/src/views/mediatypes/create.html # src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.prevalues.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.html # src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html # src/Umbraco.Web.UI/Umbraco/config/lang/da.xml # src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml # src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml # src/Umbraco.Web.UI/Umbraco/config/lang/pl.xml # src/Umbraco.Web.UI/Umbraco/config/lang/ru.xml # src/Umbraco.Web.UI/Umbraco/config/lang/sv.xml # src/Umbraco.Web.UI/Umbraco/config/lang/zh.xml # src/Umbraco.Web.UI/Umbraco/developer/Macros/editMacro.aspx # src/Umbraco.Web.UI/Umbraco/dialogs/ChangeDocType.aspx # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/umbraco/config/lang/es.xml # src/Umbraco.Web.UI/umbraco/dialogs/editMacro.aspx # src/Umbraco.Web/Controllers/UmbLoginController.cs # src/Umbraco.Web/Editors/ContentControllerBase.cs # src/Umbraco.Web/Editors/ContentTypeController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/Editors/PasswordChanger.cs # src/Umbraco.Web/HttpRequestExtensions.cs # src/Umbraco.Web/Models/ContentEditing/Tab.cs # src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs # src/Umbraco.Web/Templates/TemplateRenderer.cs # src/Umbraco.Web/Trees/ApplicationTreeController.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/_Legacy/Controls/TabView.cs # src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs # src/umbraco.cms/Actions/Action.cs # src/umbraco.providers/members/UmbracoMembershipProvider.cs
2018-11-19 15:32:26 +11:00
2018-06-29 19:52:40 +02:00
/// <summary>
/// Returns true or false if the current user has access to the node based on the user's allowed start node (path) access
/// </summary>
/// <param name="id"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
//we should remove this in v8, it's now here for backwards compat only
protected abstract bool HasPathAccess(string id, FormDataCollection queryStrings);
/// <summary>
/// Returns true or false if the current user has access to the node based on the user's allowed start node (path) access
/// </summary>
/// <param name="entity"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
protected bool HasPathAccess(IUmbracoEntity entity, FormDataCollection queryStrings)
{
if (entity == null) return false;
return RecycleBinId == Constants.System.RecycleBinContent
? Security.CurrentUser.HasContentPathAccess(entity, Services.EntityService)
: Security.CurrentUser.HasMediaPathAccess(entity, Services.EntityService);
2018-06-29 19:52:40 +02:00
}
/// <summary>
/// Ensures the recycle bin is appended when required (i.e. user has access to the root and it's not in dialog mode)
/// </summary>
/// <param name="id"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
/// <remarks>
/// This method is overwritten strictly to render the recycle bin, it should serve no other purpose
/// </remarks>
protected sealed override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
//check if we're rendering the root
if (id == Constants.System.RootString && UserStartNodes.Contains(Constants.System.Root))
2018-06-29 19:52:40 +02:00
{
var altStartId = string.Empty;
if (queryStrings.HasKey(TreeQueryStringParameters.StartNodeId))
altStartId = queryStrings.GetValue<string>(TreeQueryStringParameters.StartNodeId);
//check if a request has been made to render from a specific start node
if (string.IsNullOrEmpty(altStartId) == false && altStartId != "undefined" && altStartId != Constants.System.RootString)
2018-06-29 19:52:40 +02:00
{
id = altStartId;
}
var nodes = GetTreeNodesInternal(id, queryStrings);
//only render the recycle bin if we are not in dialog and the start id id still the root
if (IsDialog(queryStrings) == false && id == Constants.System.RootString)
2018-06-29 19:52:40 +02:00
{
nodes.Add(CreateTreeNode(
RecycleBinId.ToInvariantString(),
id,
queryStrings,
Services.TextService.Localize("general/recycleBin"),
"icon-trash",
RecycleBinSmells,
2019-01-30 19:48:42 +11:00
queryStrings.GetRequiredValue<string>("application") + TreeAlias.EnsureStartsWith('/') + "/recyclebin"));
2018-06-29 19:52:40 +02:00
}
return nodes;
}
return GetTreeNodesInternal(id, queryStrings);
}
Merge remote-tracking branch 'origin/dev-v7' into temp8 (after fixing) # Conflicts: # build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 # src/SolutionInfo.cs # src/Umbraco.Core/Configuration/UmbracoVersion.cs # src/Umbraco.Core/Constants-Applications.cs # src/Umbraco.Core/Models/Rdbms/ConsentDto.cs # src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs # src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs # src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs # src/Umbraco.Core/Services/ConsentService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/RelationService.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs # src/Umbraco.Tests/Services/ConsentServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js # src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js # src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/services/tree.service.js # src/Umbraco.Web.UI.Client/src/less/application/grid.less # src/Umbraco.Web.UI.Client/src/less/forms.less # src/Umbraco.Web.UI.Client/src/less/main.less # src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/iconpicker/iconpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/iconpicker/iconpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html # src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html # src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html # src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js # src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js # src/Umbraco.Web.UI.Client/src/views/datatypes/datatype.edit.controller.js # src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html # src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js # src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js # src/Umbraco.Web.UI.Client/src/views/mediatypes/views/permissions/permissions.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/boolean/boolean.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html # src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml # src/Umbraco.Web.UI/config/EmbeddedMedia.Release.config # src/Umbraco.Web.UI/config/EmbeddedMedia.config # src/Umbraco.Web.UI/config/trees.Release.config # src/Umbraco.Web.UI/config/trees.config # src/Umbraco.Web.UI/config/umbracoSettings.config # src/Umbraco.Web.UI/umbraco/Views/Default.cshtml # src/Umbraco.Web.UI/umbraco/config/create/UI.xml # src/Umbraco.Web.UI/umbraco/config/lang/da.xml # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/umbraco/config/lang/it.xml # src/Umbraco.Web.UI/umbraco/config/lang/nl.xml # src/Umbraco.Web.UI/umbraco/config/lang/ru.xml # src/Umbraco.Web/Editors/BackOfficeController.cs # src/Umbraco.Web/Editors/BackOfficeServerVariables.cs # src/Umbraco.Web/Editors/ContentTypeController.cs # src/Umbraco.Web/Editors/MacroController.cs # src/Umbraco.Web/Editors/MemberController.cs # src/Umbraco.Web/Models/RegisterModel.cs # src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs # src/Umbraco.Web/PublishedContentExtensions.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs
2018-07-11 15:58:48 +10:00
/// <summary>
/// Check to see if we should return children of a container node
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
/// <remarks>
/// This is required in case a user has custom start nodes that are children of a list view since in that case we'll need to render the tree node. In normal cases we don't render
/// children of a list view.
/// </remarks>
protected bool ShouldRenderChildrenOfContainer(IEntitySlim e)
{
var isContainer = e.IsContainer;
var renderChildren = e.HasChildren && (isContainer == false);
//Here we need to figure out if the node is a container and if so check if the user has a custom start node, then check if that start node is a child
// of this container node. If that is true, the HasChildren must be true so that the tree node still renders even though this current node is a container/list view.
if (isContainer && UserStartNodes.Length > 0 && UserStartNodes.Contains(Constants.System.Root) == false)
{
Merge remote-tracking branch 'origin/dev-v7' into temp8 (after fixing) # Conflicts: # build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 # src/SolutionInfo.cs # src/Umbraco.Core/Configuration/UmbracoVersion.cs # src/Umbraco.Core/Constants-Applications.cs # src/Umbraco.Core/Models/Rdbms/ConsentDto.cs # src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs # src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs # src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs # src/Umbraco.Core/Services/ConsentService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/RelationService.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs # src/Umbraco.Tests/Services/ConsentServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js # src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js # src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/services/tree.service.js # src/Umbraco.Web.UI.Client/src/less/application/grid.less # src/Umbraco.Web.UI.Client/src/less/forms.less # src/Umbraco.Web.UI.Client/src/less/main.less # src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/iconpicker/iconpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/iconpicker/iconpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html # src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html # src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html # src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js # src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js # src/Umbraco.Web.UI.Client/src/views/datatypes/datatype.edit.controller.js # src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html # src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js # src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js # src/Umbraco.Web.UI.Client/src/views/mediatypes/views/permissions/permissions.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/boolean/boolean.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html # src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml # src/Umbraco.Web.UI/config/EmbeddedMedia.Release.config # src/Umbraco.Web.UI/config/EmbeddedMedia.config # src/Umbraco.Web.UI/config/trees.Release.config # src/Umbraco.Web.UI/config/trees.config # src/Umbraco.Web.UI/config/umbracoSettings.config # src/Umbraco.Web.UI/umbraco/Views/Default.cshtml # src/Umbraco.Web.UI/umbraco/config/create/UI.xml # src/Umbraco.Web.UI/umbraco/config/lang/da.xml # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/umbraco/config/lang/it.xml # src/Umbraco.Web.UI/umbraco/config/lang/nl.xml # src/Umbraco.Web.UI/umbraco/config/lang/ru.xml # src/Umbraco.Web/Editors/BackOfficeController.cs # src/Umbraco.Web/Editors/BackOfficeServerVariables.cs # src/Umbraco.Web/Editors/ContentTypeController.cs # src/Umbraco.Web/Editors/MacroController.cs # src/Umbraco.Web/Editors/MemberController.cs # src/Umbraco.Web/Models/RegisterModel.cs # src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs # src/Umbraco.Web/PublishedContentExtensions.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs
2018-07-11 15:58:48 +10:00
var startNodes = Services.EntityService.GetAll(UmbracoObjectType, UserStartNodes);
//if any of these start nodes' parent is current, then we need to render children normally so we need to switch some logic and tell
// the UI that this node does have children and that it isn't a container
if (startNodes.Any(x => x.ParentId == e.Id))
{
renderChildren = true;
}
}
return renderChildren;
}
2018-06-29 19:52:40 +02:00
/// <summary>
/// Before we make a call to get the tree nodes we have to check if they can actually be rendered
/// </summary>
/// <param name="id"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
/// <remarks>
/// Currently this just checks if it is a container type, if it is we cannot render children. In the future this might check for other things.
/// </remarks>
private TreeNodeCollection GetTreeNodesInternal(string id, FormDataCollection queryStrings)
{
var current = GetEntityFromId(id);
//before we get the children we need to see if this is a container node
//test if the parent is a listview / container
Merge remote-tracking branch 'origin/dev-v7' into temp8 (after fixing) # Conflicts: # build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 # src/SolutionInfo.cs # src/Umbraco.Core/Configuration/UmbracoVersion.cs # src/Umbraco.Core/Constants-Applications.cs # src/Umbraco.Core/Models/Rdbms/ConsentDto.cs # src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs # src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs # src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs # src/Umbraco.Core/Services/ConsentService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/RelationService.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs # src/Umbraco.Tests/Services/ConsentServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js # src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js # src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/services/tree.service.js # src/Umbraco.Web.UI.Client/src/less/application/grid.less # src/Umbraco.Web.UI.Client/src/less/forms.less # src/Umbraco.Web.UI.Client/src/less/main.less # src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/iconpicker/iconpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/iconpicker/iconpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html # src/Umbraco.Web.UI.Client/src/views/components/html/umb-control-group.html # src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html # src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js # src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js # src/Umbraco.Web.UI.Client/src/views/datatypes/datatype.edit.controller.js # src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html # src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html # src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js # src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js # src/Umbraco.Web.UI.Client/src/views/mediatypes/views/permissions/permissions.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/boolean/boolean.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html # src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml # src/Umbraco.Web.UI/config/EmbeddedMedia.Release.config # src/Umbraco.Web.UI/config/EmbeddedMedia.config # src/Umbraco.Web.UI/config/trees.Release.config # src/Umbraco.Web.UI/config/trees.config # src/Umbraco.Web.UI/config/umbracoSettings.config # src/Umbraco.Web.UI/umbraco/Views/Default.cshtml # src/Umbraco.Web.UI/umbraco/config/create/UI.xml # src/Umbraco.Web.UI/umbraco/config/lang/da.xml # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/umbraco/config/lang/it.xml # src/Umbraco.Web.UI/umbraco/config/lang/nl.xml # src/Umbraco.Web.UI/umbraco/config/lang/ru.xml # src/Umbraco.Web/Editors/BackOfficeController.cs # src/Umbraco.Web/Editors/BackOfficeServerVariables.cs # src/Umbraco.Web/Editors/ContentTypeController.cs # src/Umbraco.Web/Editors/MacroController.cs # src/Umbraco.Web/Editors/MemberController.cs # src/Umbraco.Web/Models/RegisterModel.cs # src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs # src/Umbraco.Web/PublishedContentExtensions.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs
2018-07-11 15:58:48 +10:00
if (current != null && ShouldRenderChildrenOfContainer(current) == false)
2018-06-29 19:52:40 +02:00
{
//no children!
return new TreeNodeCollection();
}
return PerformGetTreeNodes(id, queryStrings);
}
/// <summary>
/// Checks if the menu requested is for the recycle bin and renders that, otherwise renders the result of PerformGetMenuForNode
/// </summary>
/// <param name="id"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
protected sealed override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
if (RecycleBinId.ToInvariantString() == id)
{
// get the default assigned permissions for this user
var deleteAllowed = false;
var deleteAction = Current.Actions.FirstOrDefault(y => y.Letter == ActionDelete.ActionLetter);
if (deleteAction != null)
{
var perms = Security.CurrentUser.GetPermissions(Constants.System.RecycleBinContentString, Services.UserService);
deleteAllowed = perms.FirstOrDefault(x => x.Contains(deleteAction.Letter)) != null;
}
2018-06-29 19:52:40 +02:00
var menu = new MenuItemCollection();
// only add empty recycle bin if the current user is allowed to delete by default
if (deleteAllowed)
{
menu.Items.Add(new MenuItem("emptyRecycleBin", Services.TextService)
{
Icon = "trash",
OpensDialog = true
});
menu.Items.Add(new RefreshNode(Services.TextService, true));
}
2018-06-29 19:52:40 +02:00
return menu;
}
return PerformGetMenuForNode(id, queryStrings);
}
/// <summary>
/// Based on the allowed actions, this will filter the ones that the current user is allowed
/// </summary>
/// <param name="menuWithAllItems"></param>
/// <param name="userAllowedMenuItems"></param>
/// <returns></returns>
protected void FilterUserAllowedMenuItems(MenuItemCollection menuWithAllItems, IEnumerable<MenuItem> userAllowedMenuItems)
{
var userAllowedActions = userAllowedMenuItems.Where(x => x.Action != null).Select(x => x.Action).ToArray();
var notAllowed = menuWithAllItems.Items.Where(
a => (a.Action != null
&& a.Action.CanBePermissionAssigned
&& (a.Action.CanBePermissionAssigned == false || userAllowedActions.Contains(a.Action) == false)))
.ToArray();
//remove the ones that aren't allowed.
foreach (var m in notAllowed)
{
menuWithAllItems.Items.Remove(m);
Merge remote-tracking branch 'origin/dev-v7' into temp8 # Conflicts: # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs # src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/StringExtensions.cs # src/Umbraco.Tests/Migrations/Upgrades/SqlCeUpgradeTest.cs # src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs # src/Umbraco.Web.UI.Client/package-lock.json # src/Umbraco.Web.UI.Client/package.json # src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.html # src/Umbraco.Web.UI/Umbraco/config/lang/da.xml # src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml # src/Umbraco.Web.UI/Umbraco/config/lang/ru.xml # src/Umbraco.Web.UI/Umbraco/developer/RelationTypes/EditRelationType.aspx # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/umbraco/config/lang/es.xml # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs # src/Umbraco.Web/HealthCheck/NotificationMethods/EmailNotificationMethod.cs # src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx # src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs # src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs # src/umbraco.cms/businesslogic/language/Language.cs
2018-12-06 17:13:23 +11:00
// if the disallowed action is set as default action, make sure to reset the default action as well
if (menuWithAllItems.DefaultMenuAlias == m.Alias)
{
menuWithAllItems.DefaultMenuAlias = null;
}
2018-06-29 19:52:40 +02:00
}
}
internal IEnumerable<MenuItem> GetAllowedUserMenuItemsForNode(IUmbracoEntity dd)
{
var permissionsForPath = Services.UserService.GetPermissionsForPath(Security.CurrentUser, dd.Path).GetAllPermissions();
return Current.Actions.GetByLetters(permissionsForPath).Select(x => new MenuItem(x));
2018-06-29 19:52:40 +02:00
}
/// <summary>
/// Determines if the user has access to view the node/document
2018-06-29 19:52:40 +02:00
/// </summary>
/// <param name="doc">The Document to check permissions against</param>
/// <param name="allowedUserOptions">A list of MenuItems that the user has permissions to execute on the current document</param>
/// <remarks>By default the user must have Browse permissions to see the node in the Content tree</remarks>
/// <returns></returns>
internal bool CanUserAccessNode(IUmbracoEntity doc, IEnumerable<MenuItem> allowedUserOptions, string culture)
{
// TODO: At some stage when we implement permissions on languages we'll need to take care of culture
2018-06-29 19:52:40 +02:00
return allowedUserOptions.Select(x => x.Action).OfType<ActionBrowse>().Any();
}
/// <summary>
/// this will parse the string into either a GUID or INT
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
internal Tuple<Guid?, int?> GetIdentifierFromString(string id)
{
Guid idGuid;
int idInt;
Udi idUdi;
if (Guid.TryParse(id, out idGuid))
{
return new Tuple<Guid?, int?>(idGuid, null);
}
if (int.TryParse(id, out idInt))
{
return new Tuple<Guid?, int?>(null, idInt);
}
if (Udi.TryParse(id, out idUdi))
{
var guidUdi = idUdi as GuidUdi;
if (guidUdi != null)
return new Tuple<Guid?, int?>(guidUdi.Guid, null);
}
return null;
}
/// <summary>
/// Get an entity via an id that can be either an integer, Guid or UDI
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
/// <remarks>
/// This object has it's own contextual cache for these lookups
/// </remarks>
internal IEntitySlim GetEntityFromId(string id)
{
return _entityCache.GetOrAdd(id, s =>
{
IEntitySlim entity;
if (Guid.TryParse(s, out var idGuid))
{
entity = Services.EntityService.Get(idGuid, UmbracoObjectType);
}
else if (int.TryParse(s, out var idInt))
{
entity = Services.EntityService.Get(idInt, UmbracoObjectType);
}
else if (Udi.TryParse(s, out var idUdi))
{
var guidUdi = idUdi as GuidUdi;
entity = guidUdi != null ? Services.EntityService.Get(guidUdi.Guid, UmbracoObjectType) : null;
}
else
{
entity = null;
}
return entity;
});
}
private readonly ConcurrentDictionary<string, IEntitySlim> _entityCache = new ConcurrentDictionary<string, IEntitySlim>();
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
private bool? _ignoreUserStartNodes;
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
/// <summary>
/// If the request should allows a user to choose nodes that they normally don't have access to
/// </summary>
/// <param name="queryStrings"></param>
/// <returns></returns>
internal bool IgnoreUserStartNodes(FormDataCollection queryStrings)
{
if (_ignoreUserStartNodes.HasValue) return _ignoreUserStartNodes.Value;
var dataTypeKey = queryStrings.GetValue<Guid?>(TreeQueryStringParameters.DataTypeKey);
_ignoreUserStartNodes = dataTypeKey.HasValue && Services.DataTypeService.IsDataTypeIgnoringUserStartNodes(dataTypeKey.Value);
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
return _ignoreUserStartNodes.Value;
Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken) # Conflicts: # build/NuSpecs/tools/Web.config.install.xdt # src/Umbraco.Core/Constants-DataTypes.cs # src/Umbraco.Core/Models/DataTypeDefinition.cs # src/Umbraco.Core/Models/DataTypeExtensions.cs # src/Umbraco.Core/Models/IDataTypeDefinition.cs # src/Umbraco.Core/Models/UmbracoEntity.cs # src/Umbraco.Core/Models/UserExtensions.cs # src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs # src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs # src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs # src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/DataTypeService.cs # src/Umbraco.Core/Services/EntityService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Core/Services/IDataTypeService.cs # src/Umbraco.Core/Services/IEntityService.cs # src/Umbraco.Core/Services/IRelationService.cs # src/Umbraco.Core/Services/Implement/RelationService.cs # src/Umbraco.Tests/Models/UmbracoEntityTests.cs # src/Umbraco.Tests/Plugins/PluginManagerTests.cs # src/Umbraco.Tests/Services/EntityServiceTests.cs # src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js # src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js # src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js # src/Umbraco.Web.UI.Client/src/common/services/search.service.js # src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js # src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/HtmlHelperRenderExtensions.cs # src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs # src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs # src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs # src/Umbraco.Web/Mvc/RenderRouteHandler.cs # src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs # src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs # src/Umbraco.Web/Trees/ContentTreeController.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/Trees/MediaTreeController.cs # src/Umbraco.Web/Trees/TreeControllerBase.cs # src/Umbraco.Web/Trees/TreeQueryStringParameters.cs # src/Umbraco.Web/UmbracoHelper.cs # src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs # src/Umbraco.Web/WebBootManager.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs # src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs # src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
}
2018-06-29 19:52:40 +02:00
}
}