diff --git a/src/Sql/dbo/Functions/UserCipherDetails.sql b/src/Sql/dbo/Functions/UserCipherDetails.sql index 674a4876a..d42a08cef 100644 --- a/src/Sql/dbo/Functions/UserCipherDetails.sql +++ b/src/Sql/dbo/Functions/UserCipherDetails.sql @@ -24,7 +24,9 @@ SELECT END [Edit], CASE WHEN - COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0 + OU.[AccessAll] = 1 + OR G.[AccessAll] = 1 + OR COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0 THEN 1 ELSE 0 END [ViewPassword], diff --git a/src/Sql/dbo/Functions/UserCollectionDetails.sql b/src/Sql/dbo/Functions/UserCollectionDetails.sql index 1b4908bca..e3c721009 100644 --- a/src/Sql/dbo/Functions/UserCollectionDetails.sql +++ b/src/Sql/dbo/Functions/UserCollectionDetails.sql @@ -11,7 +11,14 @@ SELECT THEN 0 ELSE 1 END [ReadOnly], - COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) AS [HidePasswords] + CASE + WHEN + OU.[AccessAll] = 1 + OR G.[AccessAll] = 1 + OR COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0 + THEN 0 + ELSE 1 + END [HidePasswords] FROM [dbo].[CollectionView] C INNER JOIN diff --git a/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql b/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql index 1391568b7..11b025aae 100644 --- a/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql +++ b/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql @@ -87,7 +87,9 @@ SELECT END [Edit], CASE WHEN - COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0 + OU.[AccessAll] = 1 + OR G.[AccessAll] = 1 + OR COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0 THEN 1 ELSE 0 END [ViewPassword], @@ -150,7 +152,14 @@ SELECT THEN 0 ELSE 1 END [ReadOnly], - COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) AS [HidePasswords] + CASE + WHEN + OU.[AccessAll] = 1 + OR G.[AccessAll] = 1 + OR COALESCE(CU.[HidePasswords], CG.[HidePasswords], 0) = 0 + THEN 0 + ELSE 1 + END [HidePasswords] FROM [dbo].[CollectionView] C INNER JOIN @@ -905,9 +914,9 @@ BEGIN END GO -IF OBJECT_ID('[dbo].[CipherDetails_Create]') IS NOT NULL +IF OBJECT_ID('[dbo].[CipherDetails_CreateWithCollections]') IS NOT NULL BEGIN - DROP PROCEDURE [dbo].[CipherDetails_Create] + DROP PROCEDURE [dbo].[CipherDetails_CreateWithCollections] END GO