mirror of https://github.com/abpframework/abp
parent
a750f0039d
commit
bcf65ab18d
@ -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