mirror of
https://github.com/bitwarden/server
synced 2025-12-10 13:23:27 +00:00
check for UserId in ReplaceAsync (#6176)
This commit is contained in:
@@ -552,6 +552,8 @@ public class CipherRepository : Repository<Core.Vault.Entities.Cipher, Cipher, G
|
|||||||
var dbContext = GetDatabaseContext(scope);
|
var dbContext = GetDatabaseContext(scope);
|
||||||
var entity = await dbContext.Ciphers.FindAsync(cipher.Id);
|
var entity = await dbContext.Ciphers.FindAsync(cipher.Id);
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
|
{
|
||||||
|
if (cipher.UserId.HasValue)
|
||||||
{
|
{
|
||||||
if (cipher.Favorite)
|
if (cipher.Favorite)
|
||||||
{
|
{
|
||||||
@@ -605,7 +607,7 @@ public class CipherRepository : Repository<Core.Vault.Entities.Cipher, Cipher, G
|
|||||||
cipher.Folders = JsonSerializer.Serialize(folders);
|
cipher.Folders = JsonSerializer.Serialize(folders);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Check if this cipher is a part of an organization, and if so do
|
// Check if this cipher is a part of an organization, and if so do
|
||||||
// not save the UserId into the database. This must be done after we
|
// not save the UserId into the database. This must be done after we
|
||||||
// set the user specific data like Folders and Favorites because
|
// set the user specific data like Folders and Favorites because
|
||||||
|
|||||||
Reference in New Issue
Block a user