mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
* work: baseline for org stuff * fix: missed view as usual oops * fix: refresh using sp_refreshsqlmodule
27 lines
652 B
Transact-SQL
27 lines
652 B
Transact-SQL
CREATE VIEW [dbo].[OrganizationUserUserDetailsView]
|
|
AS
|
|
SELECT
|
|
OU.[Id],
|
|
OU.[UserId],
|
|
OU.[OrganizationId],
|
|
U.[Name],
|
|
ISNULL(U.[Email], OU.[Email]) Email,
|
|
U.[AvatarColor],
|
|
U.[TwoFactorProviders],
|
|
U.[Premium],
|
|
OU.[Status],
|
|
OU.[Type],
|
|
OU.[AccessAll],
|
|
OU.[AccessSecretsManager],
|
|
OU.[ExternalId],
|
|
SU.[ExternalId] SsoExternalId,
|
|
OU.[Permissions],
|
|
OU.[ResetPasswordKey],
|
|
U.[UsesKeyConnector]
|
|
FROM
|
|
[dbo].[OrganizationUser] OU
|
|
LEFT JOIN
|
|
[dbo].[User] U ON U.[Id] = OU.[UserId]
|
|
LEFT JOIN
|
|
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId]
|