fix: Pass correct user id to Audit log

This commit is contained in:
Nikolaj Brask-Nielsen
2023-08-11 22:32:32 +02:00
committed by Jason Elkin
parent d33c44c0a3
commit 685b867456

View File

@@ -1097,7 +1097,8 @@ public class ContentService : RepositoryService, IContentService
scope.Notifications.Publish(
new ContentTreeChangeNotification(contentsA, TreeChangeTypes.RefreshNode, eventMessages));
Audit(AuditType.Save, userId == -1 ? 0 : userId, Constants.System.Root, "Saved multiple content");
string contentIds = string.Join(", ", contentsA.Select(x => x.Id));
Audit(AuditType.Save, userId, Constants.System.Root, $"Saved multiple content items ({contentIds})");
scope.Complete();
}
@@ -2820,7 +2821,7 @@ public class ContentService : RepositoryService, IContentService
}
else
{
Audit(AuditType.SendToPublish, content.WriterId, content.Id);
Audit(AuditType.SendToPublish, userId, content.Id);
}
return saveResult.Success;
@@ -3562,7 +3563,7 @@ public class ContentService : RepositoryService, IContentService
_documentBlueprintRepository.Save(content);
Audit(AuditType.Save, Constants.Security.SuperUserId, content.Id, $"Saved content template: {content.Name}");
Audit(AuditType.Save, userId, content.Id, $"Saved content template: {content.Name}");
scope.Notifications.Publish(new ContentSavedBlueprintNotification(content, evtMsgs));