Whe moving an item, make sure the current user is registered in Audit instead of the default user (#3150)

This commit is contained in:
Kenn Jacobsen
2018-10-08 14:27:18 +02:00
committed by Sebastiaan Janssen
parent a3cf1d7d58
commit b820baf643

View File

@@ -546,9 +546,9 @@ namespace Umbraco.Web.Editors
EnsureUniqueName(name, content, "name");
var blueprint = Services.ContentService.CreateContentFromBlueprint(content, name, Security.GetUserId());
var blueprint = Services.ContentService.CreateContentFromBlueprint(content, name, Security.CurrentUser.Id);
Services.ContentService.SaveBlueprint(blueprint, Security.GetUserId());
Services.ContentService.SaveBlueprint(blueprint, Security.CurrentUser.Id);
var notificationModel = new SimpleNotificationModel();
notificationModel.AddSuccessNotification(
@@ -755,7 +755,7 @@ namespace Umbraco.Web.Editors
return HandleContentNotFound(id, false);
}
var publishResult = Services.ContentService.PublishWithStatus(foundContent, Security.GetUserId());
var publishResult = Services.ContentService.PublishWithStatus(foundContent, Security.CurrentUser.Id);
if (publishResult.Success == false)
{
var notificationModel = new SimpleNotificationModel();
@@ -808,7 +808,7 @@ namespace Umbraco.Web.Editors
//if the current item is in the recycle bin
if (foundContent.IsInRecycleBin() == false)
{
var moveResult = Services.ContentService.WithResult().MoveToRecycleBin(foundContent, Security.GetUserId());
var moveResult = Services.ContentService.WithResult().MoveToRecycleBin(foundContent, Security.CurrentUser.Id);
if (moveResult == false)
{
//returning an object of INotificationModel will ensure that any pending
@@ -818,7 +818,7 @@ namespace Umbraco.Web.Editors
}
else
{
var deleteResult = Services.ContentService.WithResult().Delete(foundContent, Security.GetUserId());
var deleteResult = Services.ContentService.WithResult().Delete(foundContent, Security.CurrentUser.Id);
if (deleteResult == false)
{
//returning an object of INotificationModel will ensure that any pending
@@ -895,7 +895,7 @@ namespace Umbraco.Web.Editors
{
var toMove = ValidateMoveOrCopy(move);
Services.ContentService.Move(toMove, move.ParentId);
Services.ContentService.Move(toMove, move.ParentId, Security.CurrentUser.Id);
var response = Request.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent(toMove.Path, Encoding.UTF8, "application/json");