From 564b8194c1cb76b1272e7946f9816cf94492c228 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 15 May 2017 21:39:28 -0400 Subject: [PATCH] only return collections for confirmed users --- src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql b/src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql index 981016b6b..5a878845e 100644 --- a/src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql +++ b/src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql @@ -10,6 +10,8 @@ BEGIN [dbo].[CollectionView] C INNER JOIN [dbo].[OrganizationUser] OU ON C.[OrganizationId] = OU.[OrganizationId] + INNER JOIN + [dbo].[Organization] O ON C.[OrganizationId] = O.[Id] LEFT JOIN [dbo].[CollectionUser] CU ON OU.[AccessAll] = 0 AND CU.[CollectionId] = C.[Id] AND CU.[OrganizationUserId] = [OU].[Id] LEFT JOIN @@ -20,6 +22,8 @@ BEGIN [dbo].[CollectionGroup] CG ON G.[AccessAll] = 0 AND CG.[CollectionId] = C.[Id] AND CG.[GroupId] = GU.[GroupId] WHERE OU.[UserId] = @UserId + AND OU.[Status] = 2 -- 2 = Confirmed + AND O.[Enabled] = 1 AND ( OU.[AccessAll] = 1 OR CU.[CollectionId] IS NOT NULL