Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
# Conflicts: # src/Umbraco.Infrastructure/Scheduling/ScheduledPublishing.cs # src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs # src/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs # src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs # src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs # src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs # src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs # src/Umbraco.Web.BackOffice/Controllers/RedirectUrlManagementController.cs # src/Umbraco.Web.BackOffice/Controllers/UsersController.cs # src/Umbraco.Web.BackOffice/Filters/ContentModelValidator.cs # src/Umbraco.Web.BackOffice/Filters/ContentSaveModelValidator.cs # src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs # src/Umbraco.Web.BackOffice/Filters/MediaItemSaveValidationAttribute.cs # src/Umbraco.Web.BackOffice/Filters/MediaSaveModelValidator.cs # src/Umbraco.Web.BackOffice/Filters/MemberSaveModelValidator.cs # src/Umbraco.Web.BackOffice/Filters/MemberSaveValidationAttribute.cs # src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs # src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs # src/Umbraco.Web.BackOffice/Trees/MediaTreeController.cs # src/Umbraco.Web.Common/Install/InstallController.cs
This commit is contained in:
@@ -8,6 +8,7 @@ using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Mapping;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.BackOffice.Filters;
|
||||
using Umbraco.Web.Common.Attributes;
|
||||
@@ -34,7 +35,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
private readonly ILogger<DictionaryController> _logger;
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IWebSecurity _webSecurity;
|
||||
private readonly IBackofficeSecurityAccessor _backofficeSecurityAccessor;
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private readonly ILocalizedTextService _localizedTextService;
|
||||
private readonly UmbracoMapper _umbracoMapper;
|
||||
@@ -42,7 +43,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
public DictionaryController(
|
||||
ILogger<DictionaryController> logger,
|
||||
ILocalizationService localizationService,
|
||||
IWebSecurity webSecurity,
|
||||
IBackofficeSecurityAccessor backofficeSecurityAccessor,
|
||||
IOptions<GlobalSettings> globalSettings,
|
||||
ILocalizedTextService localizedTextService,
|
||||
UmbracoMapper umbracoMapper
|
||||
@@ -50,7 +51,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
_localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
|
||||
_webSecurity = webSecurity ?? throw new ArgumentNullException(nameof(webSecurity));
|
||||
_backofficeSecurityAccessor = backofficeSecurityAccessor ?? throw new ArgumentNullException(nameof(backofficeSecurityAccessor));
|
||||
_globalSettings = globalSettings.Value ?? throw new ArgumentNullException(nameof(globalSettings));
|
||||
_localizedTextService = localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
|
||||
_umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));
|
||||
@@ -74,10 +75,10 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
|
||||
foreach (var dictionaryItem in foundDictionaryDescendants)
|
||||
{
|
||||
_localizationService.Delete(dictionaryItem, _webSecurity.CurrentUser.Id);
|
||||
_localizationService.Delete(dictionaryItem, _backofficeSecurityAccessor.BackofficeSecurity.CurrentUser.Id);
|
||||
}
|
||||
|
||||
_localizationService.Delete(foundDictionary, _webSecurity.CurrentUser.Id);
|
||||
_localizationService.Delete(foundDictionary, _backofficeSecurityAccessor.BackofficeSecurity.CurrentUser.Id);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
@@ -104,7 +105,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
var message = _localizedTextService.Localize(
|
||||
"dictionaryItem/changeKeyError",
|
||||
_webSecurity.CurrentUser.GetUserCulture(_localizedTextService, _globalSettings),
|
||||
_backofficeSecurityAccessor.BackofficeSecurity.CurrentUser.GetUserCulture(_localizedTextService, _globalSettings),
|
||||
new Dictionary<string, string> { { "0", key } });
|
||||
throw HttpResponseException.CreateNotificationValidationErrorResponse(message);
|
||||
}
|
||||
@@ -218,7 +219,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
if (dictionaryItem == null)
|
||||
throw HttpResponseException.CreateNotificationValidationErrorResponse("Dictionary item does not exist");
|
||||
|
||||
var userCulture = _webSecurity.CurrentUser.GetUserCulture(_localizedTextService, _globalSettings);
|
||||
var userCulture = _backofficeSecurityAccessor.BackofficeSecurity.CurrentUser.GetUserCulture(_localizedTextService, _globalSettings);
|
||||
|
||||
if (dictionary.NameIsDirty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user