diff --git a/src/Api/Controllers/CiphersController.cs b/src/Api/Controllers/CiphersController.cs index 06df5eba4a..dcc715bd20 100644 --- a/src/Api/Controllers/CiphersController.cs +++ b/src/Api/Controllers/CiphersController.cs @@ -136,7 +136,7 @@ namespace Bit.Api.Controllers throw new NotFoundException(); } - await _cipherService.UpdatePartialAsync(new Guid(id), userId, cipher.FolderId, !cipher.Favorite); + await _cipherRepository.UpdatePartialAsync(new Guid(id), userId, cipher.FolderId, !cipher.Favorite); } [HttpPut("{id}/partial")] @@ -145,7 +145,7 @@ namespace Bit.Api.Controllers { var userId = _userService.GetProperUserId(User).Value; var folderId = string.IsNullOrWhiteSpace(model.FolderId) ? null : (Guid?)new Guid(model.FolderId); - await _cipherService.UpdatePartialAsync(new Guid(id), userId, folderId, model.Favorite); + await _cipherRepository.UpdatePartialAsync(new Guid(id), userId, folderId, model.Favorite); } [HttpPut("{id}/share")] diff --git a/src/Core/Services/ICipherService.cs b/src/Core/Services/ICipherService.cs index c7407e3302..8f87ef9dc6 100644 --- a/src/Core/Services/ICipherService.cs +++ b/src/Core/Services/ICipherService.cs @@ -9,7 +9,6 @@ namespace Bit.Core.Services public interface ICipherService { Task SaveAsync(CipherDetails cipher, Guid savingUserId); - Task UpdatePartialAsync(Guid cipherId, Guid savingUserId, Guid? folderId, bool favorite); Task DeleteAsync(CipherDetails cipher, Guid deletingUserId); Task SaveFolderAsync(Folder folder); Task DeleteFolderAsync(Folder folder); diff --git a/src/Core/Services/Implementations/CipherService.cs b/src/Core/Services/Implementations/CipherService.cs index 7a5d033a2c..2c8c34018c 100644 --- a/src/Core/Services/Implementations/CipherService.cs +++ b/src/Core/Services/Implementations/CipherService.cs @@ -65,16 +65,6 @@ namespace Bit.Core.Services } } - public async Task UpdatePartialAsync(Guid cipherId, Guid savingUserId, Guid? folderId, bool favorite) - { - if(!(await UserCanPartialEditAsync(cipherId, savingUserId))) - { - throw new BadRequestException("Cannot edit."); - } - - await _cipherRepository.UpdatePartialAsync(cipherId, savingUserId, folderId, favorite); - } - public async Task DeleteAsync(CipherDetails cipher, Guid deletingUserId) { if(!(await UserCanEditAsync(cipher, deletingUserId))) @@ -225,13 +215,5 @@ namespace Bit.Core.Services return await _subvaultUserRepository.GetCanEditByUserIdCipherIdAsync(userId, cipher.Id); } - - private Task UserCanPartialEditAsync(Guid cipherId, Guid userId) - { - // TODO: implement - - return Task.FromResult(true); - //return await _subvaultUserRepository.GetCanEditByUserIdCipherIdAsync(userId, cipherId); - } } }