From d7895d51dc9c826ac3934327145f2b94e40bd97b Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 12 Nov 2018 17:42:49 +0100 Subject: [PATCH] Do not change permissions when you import apps. --- .../Backup/RestoreGrain.cs | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs b/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs index 7c90a1584..825907dce 100644 --- a/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs +++ b/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs @@ -9,14 +9,11 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using NodaTime; -using Squidex.Domain.Apps.Core.Apps; -using Squidex.Domain.Apps.Entities.Apps.Commands; using Squidex.Domain.Apps.Entities.Backup.Helpers; using Squidex.Domain.Apps.Entities.Backup.State; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Apps; using Squidex.Infrastructure; -using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Orleans; @@ -29,7 +26,6 @@ namespace Squidex.Domain.Apps.Entities.Backup { private readonly IBackupArchiveLocation backupArchiveLocation; private readonly IClock clock; - private readonly ICommandBus commandBus; private readonly IEnumerable handlers; private readonly IEventStore eventStore; private readonly IEventDataFormatter eventDataFormatter; @@ -47,7 +43,6 @@ namespace Squidex.Domain.Apps.Entities.Backup public RestoreGrain(IBackupArchiveLocation backupArchiveLocation, IClock clock, - ICommandBus commandBus, IEventStore eventStore, IEventDataFormatter eventDataFormatter, IEnumerable handlers, @@ -57,7 +52,6 @@ namespace Squidex.Domain.Apps.Entities.Backup { Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation)); Guard.NotNull(clock, nameof(clock)); - Guard.NotNull(commandBus, nameof(commandBus)); Guard.NotNull(eventStore, nameof(eventStore)); Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); Guard.NotNull(handlers, nameof(handlers)); @@ -67,7 +61,6 @@ namespace Squidex.Domain.Apps.Entities.Backup this.backupArchiveLocation = backupArchiveLocation; this.clock = clock; - this.commandBus = commandBus; this.eventStore = eventStore; this.eventDataFormatter = eventDataFormatter; this.handlers = handlers; @@ -109,7 +102,7 @@ namespace Squidex.Domain.Apps.Entities.Backup { Guard.NotNull(url, nameof(url)); - if (newAppName != null) + if (!string.IsNullOrWhiteSpace(newAppName)) { Guard.ValidSlug(newAppName, nameof(newAppName)); } @@ -189,13 +182,6 @@ namespace Squidex.Domain.Apps.Entities.Backup } } - using (Profiler.Trace("AssignContributor")) - { - await AssignContributorAsync(); - - Log("Assigned current user as owner"); - } - CurrentJob.Status = JobStatus.Completed; Log("Completed, Yeah!"); @@ -244,18 +230,6 @@ namespace Squidex.Domain.Apps.Entities.Backup } } - private async Task AssignContributorAsync() - { - await commandBus.PublishAsync(new AssignContributor - { - Actor = actor, - AppId = CurrentJob.AppId, - ContributorId = actor.Identifier, - FromRestore = true, - Role = Role.Developer - }); - } - private async Task CleanupAsync() { await Safe.DeleteAsync(backupArchiveLocation, CurrentJob.Id, log);