1
0
mirror of https://github.com/bitwarden/server synced 2026-01-03 09:03:44 +00:00

manager group user apis

This commit is contained in:
Kyle Spearrin
2018-10-18 08:38:22 -04:00
parent 33bfd12b7d
commit 45a77c8903
13 changed files with 102 additions and 106 deletions

View File

@@ -168,7 +168,7 @@ namespace Bit.Core.Repositories.SqlServer
{
var results = await connection.ExecuteAsync(
$"[{Schema}].[CollectionUser_UpdateUsers]",
new { Id = id, Users = users.ToArrayTVP() },
new { CollectionId = id, Users = users.ToArrayTVP() },
commandType: CommandType.StoredProcedure);
}
}

View File

@@ -51,19 +51,6 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task<ICollection<GroupUserDetails>> GetManyUserDetailsByIdAsync(Guid id)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<GroupUserDetails>(
$"[{Schema}].[GroupUserDetails_ReadByGroupId]",
new { GroupId = id },
commandType: CommandType.StoredProcedure);
return results.ToList();
}
}
public async Task<ICollection<Guid>> GetManyIdsByUserIdAsync(Guid organizationUserId)
{
using(var connection = new SqlConnection(ConnectionString))
@@ -77,6 +64,19 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task<ICollection<Guid>> GetManyUserIdsByIdAsync(Guid id)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<Guid>(
$"[{Schema}].[GroupUser_ReadOrganizationUserIdsByGroupId]",
new { GroupId = id },
commandType: CommandType.StoredProcedure);
return results.ToList();
}
}
public async Task<ICollection<GroupUser>> GetManyGroupUsersByOrganizationIdAsync(Guid organizationId)
{
using(var connection = new SqlConnection(ConnectionString))