mirror of https://github.com/abpframework/abp.git
3 changed files with 30 additions and 2 deletions
@ -0,0 +1,25 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Domain.Entities.Events.Distributed; |
||||
|
using Volo.Abp.EventBus.Distributed; |
||||
|
using Volo.Abp.Users; |
||||
|
|
||||
|
namespace Volo.Abp.PermissionManagement.Identity; |
||||
|
|
||||
|
public class UserDeletedEventHandler : |
||||
|
IDistributedEventHandler<EntityDeletedEto<UserEto>>, |
||||
|
ITransientDependency |
||||
|
{ |
||||
|
protected IPermissionManager PermissionManager { get; } |
||||
|
|
||||
|
public UserDeletedEventHandler(IPermissionManager permissionManager) |
||||
|
{ |
||||
|
PermissionManager = permissionManager; |
||||
|
} |
||||
|
|
||||
|
public async Task HandleEventAsync(EntityDeletedEto<UserEto> eventData) |
||||
|
{ |
||||
|
await PermissionManager.DeleteAsync(UserPermissionValueProvider.ProviderName, eventData.Entity.Name); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue