mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Be explicit with AccessAll and fix bug in create/update cipher
This commit is contained in:
@ -17,16 +17,14 @@ SELECT
|
||||
CASE
|
||||
WHEN
|
||||
OU.[AccessAll] = 1
|
||||
OR CU.[ReadOnly] = 0
|
||||
OR G.[AccessAll] = 1
|
||||
OR CG.[ReadOnly] = 0
|
||||
OR COALESCE(CU.[ReadOnly], CG.[ReadOnly], 0) = 0
|
||||
THEN 1
|
||||
ELSE 0
|
||||
END [Edit],
|
||||
CASE
|
||||
WHEN
|
||||
CU.[HidePasswords] = 0
|
||||
OR CG.[HidePasswords] = 0
|
||||
COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0
|
||||
THEN 1
|
||||
ELSE 0
|
||||
END [ViewPassword],
|
||||
|
@ -3,7 +3,14 @@ RETURNS TABLE
|
||||
AS RETURN
|
||||
SELECT
|
||||
C.*,
|
||||
COALESCE(CU.[ReadOnly], CG.[ReadOnly], 0) AS [ReadOnly],
|
||||
CASE
|
||||
WHEN
|
||||
OU.[AccessAll] = 1
|
||||
OR G.[AccessAll] = 1
|
||||
OR COALESCE(CU.[ReadOnly], CG.[ReadOnly], 0) = 0
|
||||
THEN 0
|
||||
ELSE 1
|
||||
END [ReadOnly],
|
||||
COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) AS [HidePasswords]
|
||||
FROM
|
||||
[dbo].[CollectionView] C
|
||||
|
@ -12,6 +12,7 @@
|
||||
@FolderId UNIQUEIDENTIFIER,
|
||||
@Favorite BIT,
|
||||
@Edit BIT, -- not used
|
||||
@ViewPassword BIT, -- not used
|
||||
@OrganizationUseTotp BIT, -- not used
|
||||
@DeletedDate DATETIME2(7)
|
||||
AS
|
||||
|
@ -12,6 +12,7 @@
|
||||
@FolderId UNIQUEIDENTIFIER,
|
||||
@Favorite BIT,
|
||||
@Edit BIT, -- not used
|
||||
@ViewPassword BIT, -- not used
|
||||
@OrganizationUseTotp BIT, -- not used
|
||||
@DeletedDate DATETIME2(7),
|
||||
@CollectionIds AS [dbo].[GuidIdArray] READONLY
|
||||
@ -20,7 +21,8 @@ BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
EXEC [dbo].[CipherDetails_Create] @Id, @UserId, @OrganizationId, @Type, @Data, @Favorites, @Folders,
|
||||
@Attachments, @CreationDate, @RevisionDate, @FolderId, @Favorite, @Edit, @OrganizationUseTotp, @DeletedDate
|
||||
@Attachments, @CreationDate, @RevisionDate, @FolderId, @Favorite, @Edit, @ViewPassword,
|
||||
@OrganizationUseTotp, @DeletedDate
|
||||
|
||||
DECLARE @UpdateCollectionsSuccess INT
|
||||
EXEC @UpdateCollectionsSuccess = [dbo].[Cipher_UpdateCollections] @Id, @UserId, @OrganizationId, @CollectionIds
|
||||
|
@ -12,6 +12,7 @@
|
||||
@FolderId UNIQUEIDENTIFIER,
|
||||
@Favorite BIT,
|
||||
@Edit BIT, -- not used
|
||||
@ViewPassword BIT, -- not used
|
||||
@OrganizationUseTotp BIT, -- not used
|
||||
@DeletedDate DATETIME2(2)
|
||||
AS
|
||||
|
Reference in New Issue
Block a user