1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Move into and read ciphers from org subvaults

This commit is contained in:
Kyle Spearrin
2017-03-21 00:04:39 -04:00
parent 4779794599
commit ed8d5d69a4
22 changed files with 283 additions and 16 deletions

View File

@ -88,6 +88,21 @@ namespace Bit.Api.Controllers
// await _cipherService.SaveAsync(cipher);
//}
[HttpPut("{id}/move")]
[HttpPost("{id}/move")]
public async Task PostMoveSubvault(string id, [FromBody]CipherMoveRequestModel model)
{
var userId = _userService.GetProperUserId(User).Value;
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id));
if(cipher == null)
{
throw new NotFoundException();
}
await _cipherService.MoveSubvaultAsync(model.Cipher.ToCipher(cipher),
model.SubvaultIds.Select(s => new Guid(s)), userId);
}
[HttpDelete("{id}")]
[HttpPost("{id}/delete")]
public async Task Delete(string id)