mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
log event when removing user from group/collection
This commit is contained in:
@ -84,5 +84,16 @@ namespace Bit.Core.Services
|
||||
await _collectionRepository.DeleteAsync(collection);
|
||||
await _eventService.LogCollectionEventAsync(collection, Enums.EventType.Collection_Deleted);
|
||||
}
|
||||
|
||||
public async Task DeleteUserAsync(Collection collection, Guid organizationUserId)
|
||||
{
|
||||
var orgUser = await _organizationUserRepository.GetByIdAsync(organizationUserId);
|
||||
if(orgUser == null || orgUser.OrganizationId != collection.OrganizationId)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
await _collectionRepository.DeleteUserAsync(collection.Id, organizationUserId);
|
||||
await _eventService.LogOrganizationUserEventAsync(orgUser, Enums.EventType.OrganizationUser_Updated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user