mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
read collection that are write only
This commit is contained in:
@ -11,7 +11,7 @@ namespace Bit.Core.Repositories
|
||||
Task<int> GetCountByOrganizationIdAsync(Guid organizationId);
|
||||
Task<Tuple<Collection, ICollection<SelectionReadOnly>>> GetByIdWithGroupsAsync(Guid id);
|
||||
Task<ICollection<Collection>> GetManyByOrganizationIdAsync(Guid organizationId);
|
||||
Task<ICollection<Collection>> GetManyByUserIdAsync(Guid userId);
|
||||
Task<ICollection<Collection>> GetManyByUserIdAsync(Guid userId, bool writeOnly);
|
||||
Task<ICollection<CollectionUserDetails>> GetManyUserDetailsByIdAsync(Guid organizationId, Guid collectionId);
|
||||
Task CreateAsync(Collection obj, IEnumerable<SelectionReadOnly> groups);
|
||||
Task ReplaceAsync(Collection obj, IEnumerable<SelectionReadOnly> groups);
|
||||
|
@ -64,13 +64,13 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<Collection>> GetManyByUserIdAsync(Guid userId)
|
||||
public async Task<ICollection<Collection>> GetManyByUserIdAsync(Guid userId, bool writeOnly)
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<Collection>(
|
||||
$"[{Schema}].[Collection_ReadByUserId]",
|
||||
new { UserId = userId },
|
||||
new { UserId = userId, WriteOnly = writeOnly },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
// Return distinct Id results.
|
||||
|
Reference in New Issue
Block a user