Merge remote-tracking branch 'origin/dev-v7' into dev-v8
# Conflicts: # src/SolutionInfo.cs # src/Umbraco.Core/Configuration/UmbracoVersion.cs # src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs # src/Umbraco.Core/Persistence/PetaPoco.cs # src/Umbraco.Core/Scoping/NoScope.cs # src/Umbraco.Core/Scoping/ScopeProvider.cs # src/Umbraco.Core/Services/ContentService.cs # src/Umbraco.Core/Services/IContentService.cs # src/Umbraco.Tests/Persistence/Migrations/MigrationStartupHandlerTests.cs # src/Umbraco.Tests/UI/LegacyDialogTests.cs # src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js # src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js # src/Umbraco.Web.UI/umbraco/config/create/UI.xml # src/Umbraco.Web.UI/umbraco/config/lang/zh.xml # src/Umbraco.Web/BatchedDatabaseServerMessenger.cs # src/Umbraco.Web/Editors/ContentController.cs # src/Umbraco.Web/Editors/MediaTypeController.cs # src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs # src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs # src/Umbraco.Web/Models/Mapping/ContentModelMapper.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/PropertyEditors/NestedContentPropertyEditor.cs # src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs # src/Umbraco.Web/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web/umbraco.presentation/umbraco/create/MemberGroupTasks.cs
This commit is contained in:
@@ -14,7 +14,7 @@ using Umbraco.Web.Models.Trees;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
using System.Globalization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
using Umbraco.Web._Legacy.Actions;
|
||||
using Umbraco.Web._Legacy.Actions;
|
||||
|
||||
namespace Umbraco.Web.Trees
|
||||
{
|
||||
@@ -148,7 +148,7 @@ namespace Umbraco.Web.Trees
|
||||
}
|
||||
|
||||
// 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
|
||||
// root node, this returns the start nodes instead of root's children
|
||||
var langId = queryStrings["languageId"].TryConvertTo<int?>();
|
||||
var entities = GetChildEntities(id, langId.Success ? langId.Result : null).ToList();
|
||||
nodes.AddRange(entities.Select(x => GetSingleTreeNodeWithAccessCheck(x, id, queryStrings)).Where(x => x != null));
|
||||
@@ -194,8 +194,8 @@ namespace Umbraco.Web.Trees
|
||||
|
||||
entityId = entity.Id;
|
||||
}
|
||||
|
||||
IEntitySlim[] result;
|
||||
|
||||
IEntitySlim[] result;
|
||||
|
||||
// if a request is made for the root node but user has no access to
|
||||
// root node, return start nodes instead
|
||||
@@ -204,31 +204,31 @@ namespace Umbraco.Web.Trees
|
||||
result = UserStartNodes.Length > 0
|
||||
? Services.EntityService.GetAll(UmbracoObjectType, UserStartNodes).ToArray()
|
||||
: Array.Empty<IEntitySlim>();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Services.EntityService.GetChildren(entityId, UmbracoObjectType).ToArray();
|
||||
}
|
||||
|
||||
if (langId.HasValue)
|
||||
{
|
||||
//need to update all node names
|
||||
//TODO: This is not currently stored, we need to wait until U4-11128 is complete for this to work, in the meantime
|
||||
// we'll mock using this and it will just be some mock data
|
||||
foreach(var e in result)
|
||||
{
|
||||
if (e.AdditionalData.TryGetValue("VariantNames", out var variantNames))
|
||||
{
|
||||
var casted = (IDictionary<int, string>)variantNames;
|
||||
e.Name = casted[langId.Value];
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Name = e.Name + " (lang: " + langId.Value + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Services.EntityService.GetChildren(entityId, UmbracoObjectType).ToArray();
|
||||
}
|
||||
|
||||
if (langId.HasValue)
|
||||
{
|
||||
//need to update all node names
|
||||
//TODO: This is not currently stored, we need to wait until U4-11128 is complete for this to work, in the meantime
|
||||
// we'll mock using this and it will just be some mock data
|
||||
foreach(var e in result)
|
||||
{
|
||||
if (e.AdditionalData.TryGetValue("VariantNames", out var variantNames))
|
||||
{
|
||||
var casted = (IDictionary<int, string>)variantNames;
|
||||
e.Name = casted[langId.Value];
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Name = e.Name + " (lang: " + langId.Value + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace Umbraco.Web.Trees
|
||||
/// <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, int? langId)
|
||||
{
|
||||
{
|
||||
//TODO: At some stage when we implement permissions on languages we'll need to take care of langId
|
||||
return allowedUserOptions.Select(x => x.Action).OfType<ActionBrowse>().Any();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user