mirror of
https://github.com/bitwarden/server.git
synced 2025-07-14 22:27:32 -05:00
[PM-15179] Implement endpoints to add existing organization to CB provider (#5310)
* Implement endpoints to add existing organization to provider * Run dotnet format * Support MOE * Run dotnet format * Move ProviderClientsController under AC ownership * Move ProviderClientsControllerTests under AC ownership * Jared's feedback
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using System.Data;
|
||||
using Bit.Core.AdminConsole.Entities;
|
||||
using Bit.Core.AdminConsole.Enums.Provider;
|
||||
using Bit.Core.Auth.Entities;
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Models.Data.Organizations;
|
||||
@ -180,4 +181,19 @@ public class OrganizationRepository : Repository<Organization, Guid>, IOrganizat
|
||||
return result.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<Organization>> GetAddableToProviderByUserIdAsync(
|
||||
Guid userId,
|
||||
ProviderType providerType)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var result = await connection.QueryAsync<Organization>(
|
||||
$"[{Schema}].[{Table}_ReadAddableToProviderByUserId]",
|
||||
new { UserId = userId, ProviderType = providerType },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return result.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user