Browse Source
Make the `HandleEventAsync` method UOW.
pull/18051/head
maliming
2 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
9 additions and
3 deletions
-
modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/RoleDeletedEventHandler.cs
-
modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/UserDeletedEventHandler.cs
-
modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/UserDeletedEventHandler.cs
|
|
|
@ -5,6 +5,7 @@ using Volo.Abp.Domain.Entities.Events.Distributed; |
|
|
|
using Volo.Abp.EventBus; |
|
|
|
using Volo.Abp.EventBus.Distributed; |
|
|
|
using Volo.Abp.Identity; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
|
|
|
|
namespace Volo.Abp.PermissionManagement.Identity; |
|
|
|
|
|
|
|
@ -19,7 +20,8 @@ public class RoleDeletedEventHandler : |
|
|
|
PermissionManager = permissionManager; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task HandleEventAsync(EntityDeletedEto<IdentityRoleEto> eventData) |
|
|
|
[UnitOfWork] |
|
|
|
public virtual async Task HandleEventAsync(EntityDeletedEto<IdentityRoleEto> eventData) |
|
|
|
{ |
|
|
|
await PermissionManager.DeleteAsync(RolePermissionValueProvider.ProviderName, eventData.Entity.Name); |
|
|
|
} |
|
|
|
|
|
|
|
@ -3,6 +3,7 @@ using Volo.Abp.Authorization.Permissions; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
using Volo.Abp.Domain.Entities.Events.Distributed; |
|
|
|
using Volo.Abp.EventBus.Distributed; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Volo.Abp.Users; |
|
|
|
|
|
|
|
namespace Volo.Abp.PermissionManagement.Identity; |
|
|
|
@ -18,7 +19,8 @@ public class UserDeletedEventHandler : |
|
|
|
PermissionManager = permissionManager; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task HandleEventAsync(EntityDeletedEto<UserEto> eventData) |
|
|
|
[UnitOfWork] |
|
|
|
public virtual async Task HandleEventAsync(EntityDeletedEto<UserEto> eventData) |
|
|
|
{ |
|
|
|
await PermissionManager.DeleteAsync(UserPermissionValueProvider.ProviderName, eventData.Entity.Id.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -3,6 +3,7 @@ using Volo.Abp.DependencyInjection; |
|
|
|
using Volo.Abp.Domain.Entities.Events.Distributed; |
|
|
|
using Volo.Abp.EventBus.Distributed; |
|
|
|
using Volo.Abp.Settings; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Volo.Abp.Users; |
|
|
|
|
|
|
|
namespace Volo.Abp.SettingManagement; |
|
|
|
@ -18,7 +19,8 @@ public class UserDeletedEventHandler : |
|
|
|
SettingManager = settingManager; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task HandleEventAsync(EntityDeletedEto<UserEto> eventData) |
|
|
|
[UnitOfWork] |
|
|
|
public virtual async Task HandleEventAsync(EntityDeletedEto<UserEto> eventData) |
|
|
|
{ |
|
|
|
await SettingManager.DeleteAsync(UserSettingValueProvider.ProviderName, eventData.Entity.Id.ToString()); |
|
|
|
} |
|
|
|
|