mirror of
https://github.com/bitwarden/server.git
synced 2025-07-16 23:27:30 -05:00
[PM-18527] - Fix allowing restored user to own multiple free orgs (#5444)
* Moved RestoreUserAsync and RestoreUsersAsync to Command.
* Fixing the bug.
* Added test for bulk method.
* Fixing sonar cube warning.
* SonarQube warning fix.
* Excluding org users we already have.
* Fixed misspelling. Added integration test for method.
* test had the misspelling as well 🤦
* Split out interface. Added admin and confirmed constraints.
* fixed queries and added xml comments and tests.
This commit is contained in:
@ -196,4 +196,15 @@ public class OrganizationRepository : Repository<Organization, Guid>, IOrganizat
|
||||
return result.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<Organization>> GetManyByIdsAsync(IEnumerable<Guid> ids)
|
||||
{
|
||||
await using var connection = new SqlConnection(ConnectionString);
|
||||
|
||||
return (await connection.QueryAsync<Organization>(
|
||||
$"[{Schema}].[{Table}_ReadManyByIds]",
|
||||
new { OrganizationIds = ids.ToGuidIdArrayTVP() },
|
||||
commandType: CommandType.StoredProcedure))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user