1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-17 02:01:53 +01:00

userid set only when creating with collection ids

This commit is contained in:
Kyle Spearrin 2018-10-22 10:16:56 -04:00
parent c710226223
commit 3f319aee64

View File

@ -63,11 +63,12 @@ namespace Bit.Core.Services
throw new BadRequestException("You do not have permissions to edit this.");
}
cipher.UserId = savingUserId;
if(cipher.Id == default(Guid))
{
if(cipher.OrganizationId.HasValue && collectionIds != null)
{
// Set user ID to limit scope of collection ids in the create sproc
cipher.UserId = savingUserId;
await _cipherRepository.CreateAsync(cipher, collectionIds);
}
else