1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

events for collections, groups, and org users

This commit is contained in:
Kyle Spearrin
2017-12-01 16:00:30 -05:00
parent a8fefb54c4
commit 28770d3761
20 changed files with 182 additions and 27 deletions

View File

@ -63,7 +63,31 @@ namespace Bit.Core.Services
return;
}
var e = new CipherEvent(cipher, type, _currentContext?.UserId);
var e = new CipherEvent(cipher, _currentContext?.UserId, type);
await _eventRepository.CreateAsync(e);
}
public async Task LogCollectionEventAsync(Collection collection, EventType type)
{
var e = new CollectionEvent(collection, _currentContext.UserId.Value, type);
await _eventRepository.CreateAsync(e);
}
public async Task LogGroupEventAsync(Group group, EventType type)
{
var e = new GroupEvent(group, _currentContext.UserId.Value, type);
await _eventRepository.CreateAsync(e);
}
public async Task LogOrganizationUserEventAsync(OrganizationUser organizationUser, EventType type)
{
var e = new OrganizationUserEvent(organizationUser, _currentContext.UserId.Value, type);
await _eventRepository.CreateAsync(e);
}
public async Task LogOrganizationEventAsync(Organization organization, EventType type)
{
var e = new OrganizationEvent(organization, _currentContext.UserId.Value, type);
await _eventRepository.CreateAsync(e);
}
}