mirror of
https://github.com/bitwarden/server.git
synced 2024-11-26 12:55:17 +01:00
updates to CipherDetails query for accurate ViewPassword value
This commit is contained in:
parent
441d2e7052
commit
a9d1df64bc
@ -5,12 +5,41 @@ AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT TOP 1
|
||||
*
|
||||
SELECT
|
||||
[Id],
|
||||
[UserId],
|
||||
[OrganizationId],
|
||||
[Type],
|
||||
[Data],
|
||||
[Attachments],
|
||||
[CreationDate],
|
||||
[RevisionDate],
|
||||
[Favorite],
|
||||
[FolderId],
|
||||
[DeletedDate],
|
||||
[Reprompt],
|
||||
[Key],
|
||||
[OrganizationUseTotp]
|
||||
, MAX ([Edit]) AS [Edit]
|
||||
, MAX ([ViewPassword]) AS [ViewPassword]
|
||||
FROM
|
||||
[dbo].[UserCipherDetails](@UserId)
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
ORDER BY
|
||||
[Edit] DESC
|
||||
GROUP BY
|
||||
[Id],
|
||||
[UserId],
|
||||
[OrganizationId],
|
||||
[Type],
|
||||
[Data],
|
||||
[Attachments],
|
||||
[CreationDate],
|
||||
[RevisionDate],
|
||||
[Favorite],
|
||||
[FolderId],
|
||||
[DeletedDate],
|
||||
[Reprompt],
|
||||
[Key],
|
||||
[OrganizationUseTotp]
|
||||
|
||||
END
|
@ -0,0 +1,45 @@
|
||||
CREATE OR ALTER PROCEDURE [dbo].[CipherDetails_ReadByIdUserId]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
[Id],
|
||||
[UserId],
|
||||
[OrganizationId],
|
||||
[Type],
|
||||
[Data],
|
||||
[Attachments],
|
||||
[CreationDate],
|
||||
[RevisionDate],
|
||||
[Favorite],
|
||||
[FolderId],
|
||||
[DeletedDate],
|
||||
[Reprompt],
|
||||
[Key],
|
||||
[OrganizationUseTotp],
|
||||
MAX ([Edit]) AS [Edit],
|
||||
MAX ([ViewPassword]) AS [ViewPassword]
|
||||
FROM
|
||||
[dbo].[UserCipherDetails](@UserId)
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
GROUP BY
|
||||
[Id],
|
||||
[UserId],
|
||||
[OrganizationId],
|
||||
[Type],
|
||||
[Data],
|
||||
[Attachments],
|
||||
[CreationDate],
|
||||
[RevisionDate],
|
||||
[Favorite],
|
||||
[FolderId],
|
||||
[DeletedDate],
|
||||
[Reprompt],
|
||||
[Key],
|
||||
[OrganizationUseTotp]
|
||||
END
|
||||
GO
|
Loading…
Reference in New Issue
Block a user