mirror of
https://github.com/bitwarden/server.git
synced 2025-05-29 23:34:53 -05:00
userid set only when creating with collection ids
This commit is contained in:
parent
c710226223
commit
3f319aee64
@ -63,11 +63,12 @@ namespace Bit.Core.Services
|
|||||||
throw new BadRequestException("You do not have permissions to edit this.");
|
throw new BadRequestException("You do not have permissions to edit this.");
|
||||||
}
|
}
|
||||||
|
|
||||||
cipher.UserId = savingUserId;
|
|
||||||
if(cipher.Id == default(Guid))
|
if(cipher.Id == default(Guid))
|
||||||
{
|
{
|
||||||
if(cipher.OrganizationId.HasValue && collectionIds != null)
|
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);
|
await _cipherRepository.CreateAsync(cipher, collectionIds);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user