mirror of
https://github.com/bitwarden/server
synced 2026-01-06 02:23:51 +00:00
only update user groups if they are not the same
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Bit.Core.Repositories
|
||||
Task<ICollection<Group>> GetManyByOrganizationIdAsync(Guid organizationId);
|
||||
Task<ICollection<GroupUserDetails>> GetManyUserDetailsByIdAsync(Guid id);
|
||||
Task<ICollection<Guid>> GetManyIdsByUserIdAsync(Guid organizationUserId);
|
||||
Task<ICollection<GroupUser>> GetManyGroupUsersByOrganizationIdAsync(Guid organizationId);
|
||||
Task CreateAsync(Group obj, IEnumerable<SelectionReadOnly> collections);
|
||||
Task ReplaceAsync(Group obj, IEnumerable<SelectionReadOnly> collections);
|
||||
Task DeleteUserAsync(Guid groupId, Guid organizationUserId);
|
||||
|
||||
@@ -77,6 +77,19 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<GroupUser>> GetManyGroupUsersByOrganizationIdAsync(Guid organizationId)
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<GroupUser>(
|
||||
$"[{Schema}].[GroupUser_ReadByOrganizationId]",
|
||||
new { OrganizationId = organizationId },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task CreateAsync(Group obj, IEnumerable<SelectionReadOnly> collections)
|
||||
{
|
||||
obj.SetNewId();
|
||||
|
||||
Reference in New Issue
Block a user