diff --git a/src/Api/Controllers/CiphersController.cs b/src/Api/Controllers/CiphersController.cs index 1b853295e7..ce1bf18672 100644 --- a/src/Api/Controllers/CiphersController.cs +++ b/src/Api/Controllers/CiphersController.cs @@ -10,7 +10,6 @@ using Bit.Core.Services; using Bit.Core; using Bit.Api.Utilities; using Bit.Core.Utilities; -using Core.Models.Data; using System.Collections.Generic; using Bit.Core.Models.Table; diff --git a/src/Core/Services/Implementations/CipherService.cs b/src/Core/Services/Implementations/CipherService.cs index 040317f354..88fa19b2b8 100644 --- a/src/Core/Services/Implementations/CipherService.cs +++ b/src/Core/Services/Implementations/CipherService.cs @@ -478,6 +478,10 @@ namespace Bit.Core.Services } else { + if(!(await UserCanEditAsync(cipher, savingUserId))) + { + throw new BadRequestException("You do not have permissions to edit this."); + } await _collectionCipherRepository.UpdateCollectionsAsync(cipher.Id, savingUserId, collectionIds); }