mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05:00
update OrgUserDetailsView to include PlanType and other sponsorship parameters previously removed (#2122)
This commit is contained in:
parent
6628dc3336
commit
be146a8f62
@ -54,8 +54,11 @@ namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
|||||||
PrivateKey = x.o.PrivateKey,
|
PrivateKey = x.o.PrivateKey,
|
||||||
ProviderId = x.p.Id,
|
ProviderId = x.p.Id,
|
||||||
ProviderName = x.p.Name,
|
ProviderName = x.p.Name,
|
||||||
FamilySponsorshipFriendlyName = x.os.FriendlyName,
|
|
||||||
SsoConfig = x.ss.Data,
|
SsoConfig = x.ss.Data,
|
||||||
|
FamilySponsorshipFriendlyName = x.os.FriendlyName,
|
||||||
|
FamilySponsorshipLastSyncDate = x.os.LastSyncDate,
|
||||||
|
FamilySponsorshipToDelete = x.os.ToDelete,
|
||||||
|
FamilySponsorshipValidUntil = x.os.ValidUntil
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ SELECT
|
|||||||
OU.[OrganizationId],
|
OU.[OrganizationId],
|
||||||
O.[Name],
|
O.[Name],
|
||||||
O.[Enabled],
|
O.[Enabled],
|
||||||
|
O.[PlanType],
|
||||||
O.[UsePolicies],
|
O.[UsePolicies],
|
||||||
O.[UseSso],
|
O.[UseSso],
|
||||||
O.[UseKeyConnector],
|
O.[UseKeyConnector],
|
||||||
@ -32,7 +33,11 @@ SELECT
|
|||||||
OU.[Permissions],
|
OU.[Permissions],
|
||||||
PO.[ProviderId],
|
PO.[ProviderId],
|
||||||
P.[Name] ProviderName,
|
P.[Name] ProviderName,
|
||||||
SS.[Data] SsoConfig
|
SS.[Data] SsoConfig,
|
||||||
|
OS.[FriendlyName] FamilySponsorshipFriendlyName,
|
||||||
|
OS.[LastSyncDate] FamilySponsorshipLastSyncDate,
|
||||||
|
OS.[ToDelete] FamilySponsorshipToDelete,
|
||||||
|
OS.[ValidUntil] FamilySponsorshipValidUntil
|
||||||
FROM
|
FROM
|
||||||
[dbo].[OrganizationUser] OU
|
[dbo].[OrganizationUser] OU
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
@ -45,3 +50,5 @@ LEFT JOIN
|
|||||||
[dbo].[Provider] P ON P.[Id] = PO.[ProviderId]
|
[dbo].[Provider] P ON P.[Id] = PO.[ProviderId]
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
[dbo].[SsoConfig] SS ON SS.[OrganizationId] = OU.[OrganizationId]
|
[dbo].[SsoConfig] SS ON SS.[OrganizationId] = OU.[OrganizationId]
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[OrganizationSponsorship] OS ON OS.[SponsoringOrganizationUserID] = OU.[Id]
|
||||||
|
62
util/Migrator/DbScripts/2022-07-15_00_FixOrgUserDetails.sql
Normal file
62
util/Migrator/DbScripts/2022-07-15_00_FixOrgUserDetails.sql
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'OrganizationUserOrganizationDetailsView')
|
||||||
|
BEGIN
|
||||||
|
DROP VIEW [dbo].[OrganizationUserOrganizationDetailsView]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE VIEW [dbo].[OrganizationUserOrganizationDetailsView]
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
OU.[UserId],
|
||||||
|
OU.[OrganizationId],
|
||||||
|
O.[Name],
|
||||||
|
O.[Enabled],
|
||||||
|
O.[PlanType],
|
||||||
|
O.[UsePolicies],
|
||||||
|
O.[UseSso],
|
||||||
|
O.[UseKeyConnector],
|
||||||
|
O.[UseScim],
|
||||||
|
O.[UseGroups],
|
||||||
|
O.[UseDirectory],
|
||||||
|
O.[UseEvents],
|
||||||
|
O.[UseTotp],
|
||||||
|
O.[Use2fa],
|
||||||
|
O.[UseApi],
|
||||||
|
O.[UseResetPassword],
|
||||||
|
O.[SelfHost],
|
||||||
|
O.[UsersGetPremium],
|
||||||
|
O.[Seats],
|
||||||
|
O.[MaxCollections],
|
||||||
|
O.[MaxStorageGb],
|
||||||
|
O.[Identifier],
|
||||||
|
OU.[Key],
|
||||||
|
OU.[ResetPasswordKey],
|
||||||
|
O.[PublicKey],
|
||||||
|
O.[PrivateKey],
|
||||||
|
OU.[Status],
|
||||||
|
OU.[Type],
|
||||||
|
SU.[ExternalId] SsoExternalId,
|
||||||
|
OU.[Permissions],
|
||||||
|
PO.[ProviderId],
|
||||||
|
P.[Name] ProviderName,
|
||||||
|
SS.[Data] SsoConfig,
|
||||||
|
OS.[FriendlyName] FamilySponsorshipFriendlyName,
|
||||||
|
OS.[LastSyncDate] FamilySponsorshipLastSyncDate,
|
||||||
|
OS.[ToDelete] FamilySponsorshipToDelete,
|
||||||
|
OS.[ValidUntil] FamilySponsorshipValidUntil
|
||||||
|
FROM
|
||||||
|
[dbo].[OrganizationUser] OU
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[Organization] O ON O.[Id] = OU.[OrganizationId]
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId]
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[ProviderOrganization] PO ON PO.[OrganizationId] = O.[Id]
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[Provider] P ON P.[Id] = PO.[ProviderId]
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[SsoConfig] SS ON SS.[OrganizationId] = OU.[OrganizationId]
|
||||||
|
LEFT JOIN
|
||||||
|
[dbo].[OrganizationSponsorship] OS ON OS.[SponsoringOrganizationUserID] = OU.[Id]
|
||||||
|
GO
|
Loading…
x
Reference in New Issue
Block a user