mirror of
https://github.com/bitwarden/server
synced 2026-01-05 01:53:17 +00:00
[PM-22219] - [Vault] [Server] Exclude items in default collections from Admin Console (#5992)
* add GetAllOrganizationCiphersExcludingDefaultUserCollections * add sproc * update sproc and feature flag name * add sproc. update tests * rename sproc * rename sproc * use single sproc * revert change * remove unused code. update sproc * remove joins from proc * update migration filename * fix syntax * fix indentation * remove unnecessary feature flag and go statements. clean up code * update sproc, view, and index * update sproc * update index * update timestamp * update filename. update sproc to match EF filter * match only enabled organizations. make index creation idempotent * update file timestamp * update timestamp * use square brackets * add square brackets * formatting fixes * rename view * remove index
This commit is contained in:
@@ -37,4 +37,10 @@ public interface IOrganizationCiphersQuery
|
||||
/// </remarks>
|
||||
public Task<IEnumerable<CipherOrganizationDetailsWithCollections>> GetOrganizationCiphersByCollectionIds(
|
||||
Guid organizationId, IEnumerable<Guid> collectionIds);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all organization ciphers except those in default user collections.
|
||||
/// </summary>
|
||||
public Task<IEnumerable<CipherOrganizationDetailsWithCollections>>
|
||||
GetAllOrganizationCiphersExcludingDefaultUserCollections(Guid organizationId);
|
||||
}
|
||||
|
||||
@@ -61,4 +61,10 @@ public class OrganizationCiphersQuery : IOrganizationCiphersQuery
|
||||
var allOrganizationCiphers = await GetAllOrganizationCiphers(organizationId);
|
||||
return allOrganizationCiphers.Where(c => c.CollectionIds.Intersect(managedCollectionIds).Any());
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<CipherOrganizationDetailsWithCollections>>
|
||||
GetAllOrganizationCiphersExcludingDefaultUserCollections(Guid orgId)
|
||||
{
|
||||
return (await _cipherRepository.GetManyCipherOrganizationDetailsExcludingDefaultCollectionsAsync(orgId)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,12 @@ public interface ICipherRepository : IRepository<Cipher, Guid>
|
||||
/// <param name="ciphers">A list of ciphers with updated data</param>
|
||||
UpdateEncryptedDataForKeyRotation UpdateForKeyRotation(Guid userId,
|
||||
IEnumerable<Cipher> ciphers);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all ciphers belonging to the organization excluding those with default collections
|
||||
/// </summary>
|
||||
Task<IEnumerable<CipherOrganizationDetailsWithCollections>>
|
||||
GetManyCipherOrganizationDetailsExcludingDefaultCollectionsAsync(Guid organizationId);
|
||||
/// <inheritdoc cref="UpdateForKeyRotation(Guid, IEnumerable{Cipher})"/>
|
||||
/// <remarks>
|
||||
/// This version uses the bulk resource creation service to create the temp table.
|
||||
|
||||
Reference in New Issue
Block a user