2023-10-27 03:38:29 +10:00
|
|
|
|
using Bit.Core.AdminConsole.Models.Data.Provider;
|
|
|
|
|
|
using Bit.Infrastructure.EntityFramework.Repositories;
|
|
|
|
|
|
using Bit.Infrastructure.EntityFramework.Repositories.Queries;
|
2021-07-15 16:37:27 +02:00
|
|
|
|
|
2023-10-27 03:38:29 +10:00
|
|
|
|
namespace Bit.Infrastructure.EntityFramework.AdminConsole.Repositories.Queries;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2022-01-11 10:40:51 +01:00
|
|
|
|
public class ProviderUserOrganizationDetailsViewQuery : IQuery<ProviderUserOrganizationDetails>
|
2021-07-15 16:37:27 +02:00
|
|
|
|
{
|
|
|
|
|
|
public IQueryable<ProviderUserOrganizationDetails> Run(DatabaseContext dbContext)
|
|
|
|
|
|
{
|
|
|
|
|
|
var query = from pu in dbContext.ProviderUsers
|
|
|
|
|
|
join po in dbContext.ProviderOrganizations on pu.ProviderId equals po.ProviderId
|
|
|
|
|
|
join o in dbContext.Organizations on po.OrganizationId equals o.Id
|
|
|
|
|
|
join p in dbContext.Providers on pu.ProviderId equals p.Id
|
|
|
|
|
|
select new { pu, po, o, p };
|
|
|
|
|
|
return query.Select(x => new ProviderUserOrganizationDetails
|
|
|
|
|
|
{
|
|
|
|
|
|
OrganizationId = x.po.OrganizationId,
|
|
|
|
|
|
UserId = x.pu.UserId,
|
|
|
|
|
|
Name = x.o.Name,
|
|
|
|
|
|
Enabled = x.o.Enabled,
|
|
|
|
|
|
UsePolicies = x.o.UsePolicies,
|
|
|
|
|
|
UseSso = x.o.UseSso,
|
2021-11-17 11:46:35 +01:00
|
|
|
|
UseKeyConnector = x.o.UseKeyConnector,
|
2022-07-14 15:58:48 -04:00
|
|
|
|
UseScim = x.o.UseScim,
|
2021-07-15 16:37:27 +02:00
|
|
|
|
UseGroups = x.o.UseGroups,
|
|
|
|
|
|
UseDirectory = x.o.UseDirectory,
|
|
|
|
|
|
UseEvents = x.o.UseEvents,
|
|
|
|
|
|
UseTotp = x.o.UseTotp,
|
|
|
|
|
|
Use2fa = x.o.Use2fa,
|
|
|
|
|
|
UseApi = x.o.UseApi,
|
|
|
|
|
|
SelfHost = x.o.SelfHost,
|
|
|
|
|
|
UsersGetPremium = x.o.UsersGetPremium,
|
2022-12-06 09:50:08 +00:00
|
|
|
|
UseCustomPermissions = x.o.UseCustomPermissions,
|
2021-07-15 16:37:27 +02:00
|
|
|
|
Seats = x.o.Seats,
|
|
|
|
|
|
MaxCollections = x.o.MaxCollections,
|
|
|
|
|
|
MaxStorageGb = x.o.MaxStorageGb,
|
|
|
|
|
|
Identifier = x.o.Identifier,
|
|
|
|
|
|
Key = x.po.Key,
|
|
|
|
|
|
Status = x.pu.Status,
|
|
|
|
|
|
Type = x.pu.Type,
|
|
|
|
|
|
PublicKey = x.o.PublicKey,
|
|
|
|
|
|
PrivateKey = x.o.PrivateKey,
|
|
|
|
|
|
ProviderId = x.p.Id,
|
|
|
|
|
|
ProviderName = x.p.Name,
|
2024-01-29 20:04:45 +00:00
|
|
|
|
PlanType = x.o.PlanType,
|
2024-10-18 11:00:01 -04:00
|
|
|
|
LimitCollectionCreation = x.o.LimitCollectionCreation,
|
|
|
|
|
|
LimitCollectionDeletion = x.o.LimitCollectionDeletion,
|
2025-01-28 12:58:04 -05:00
|
|
|
|
LimitItemDeletion = x.o.LimitItemDeletion,
|
2024-01-29 20:04:45 +00:00
|
|
|
|
AllowAdminAccessToAllCollectionItems = x.o.AllowAdminAccessToAllCollectionItems,
|
2024-12-05 10:46:01 -06:00
|
|
|
|
UseRiskInsights = x.o.UseRiskInsights,
|
2025-01-06 10:34:52 -06:00
|
|
|
|
ProviderType = x.p.Type
|
2021-07-15 16:37:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|