1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

log event when removing user from group/collection

This commit is contained in:
Kyle Spearrin
2018-07-09 23:07:04 -04:00
parent 90df2f21e5
commit 9fee09e204
8 changed files with 34 additions and 7 deletions

View File

@ -155,7 +155,7 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
await _collectionRepository.DeleteUserAsync(collection.Id, new Guid(orgUserId));
await _collectionService.DeleteUserAsync(collection, new Guid(orgUserId));
}
}
}

View File

@ -8,7 +8,6 @@ using Bit.Core.Models.Api;
using Bit.Core.Exceptions;
using Bit.Core.Services;
using Bit.Core;
using System.Collections.Generic;
namespace Bit.Api.Controllers
{
@ -98,7 +97,6 @@ namespace Bit.Api.Controllers
}
[HttpPut("{id}")]
[HttpPost("{id}")]
public async Task<GroupResponseModel> Put(string orgId, string id, [FromBody]GroupRequestModel model)
{
var group = await _groupRepository.GetByIdAsync(new Guid(id));
@ -112,7 +110,6 @@ namespace Bit.Api.Controllers
}
[HttpDelete("{id}")]
[HttpPost("{id}/delete")]
public async Task Delete(string orgId, string id)
{
var group = await _groupRepository.GetByIdAsync(new Guid(id));
@ -125,7 +122,6 @@ namespace Bit.Api.Controllers
}
[HttpDelete("{id}/user/{orgUserId}")]
[HttpPost("{id}/delete-user/{orgUserId}")]
public async Task Delete(string orgId, string id, string orgUserId)
{
var group = await _groupRepository.GetByIdAsync(new Guid(id));
@ -134,7 +130,7 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
await _groupRepository.DeleteUserAsync(group.Id, new Guid(orgUserId));
await _groupService.DeleteUserAsync(group, new Guid(orgUserId));
}
}
}