mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.4 KiB
45 lines
1.4 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using Squidex.Domain.Apps.Core.Apps;
|
|
using Squidex.Domain.Apps.Events;
|
|
using Squidex.Infrastructure.EventSourcing;
|
|
using Squidex.Infrastructure.Reflection;
|
|
using AppClientUpdatedV2 = Squidex.Domain.Apps.Events.Apps.AppClientUpdated;
|
|
|
|
namespace Migrate_01.OldEvents
|
|
{
|
|
[EventType(nameof(AppClientUpdated))]
|
|
[Obsolete]
|
|
public sealed class AppClientUpdated : AppEvent, IMigratedEvent
|
|
{
|
|
public string Id { get; set; }
|
|
|
|
public AppClientPermission Permission { get; set; }
|
|
|
|
public IEvent Migrate()
|
|
{
|
|
var result = SimpleMapper.Map(this, new AppClientUpdatedV2());
|
|
|
|
switch (Permission)
|
|
{
|
|
case AppClientPermission.Developer:
|
|
result.Role = Role.Developer;
|
|
break;
|
|
case AppClientPermission.Editor:
|
|
result.Role = Role.Editor;
|
|
break;
|
|
case AppClientPermission.Reader:
|
|
result.Role = Role.Reader;
|
|
break;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|