mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
only return collections for confirmed users
This commit is contained in:
@ -10,6 +10,8 @@ BEGIN
|
|||||||
[dbo].[CollectionView] C
|
[dbo].[CollectionView] C
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
[dbo].[OrganizationUser] OU ON C.[OrganizationId] = OU.[OrganizationId]
|
[dbo].[OrganizationUser] OU ON C.[OrganizationId] = OU.[OrganizationId]
|
||||||
|
INNER JOIN
|
||||||
|
[dbo].[Organization] O ON C.[OrganizationId] = O.[Id]
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
[dbo].[CollectionUser] CU ON OU.[AccessAll] = 0 AND CU.[CollectionId] = C.[Id] AND CU.[OrganizationUserId] = [OU].[Id]
|
[dbo].[CollectionUser] CU ON OU.[AccessAll] = 0 AND CU.[CollectionId] = C.[Id] AND CU.[OrganizationUserId] = [OU].[Id]
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
@ -20,6 +22,8 @@ BEGIN
|
|||||||
[dbo].[CollectionGroup] CG ON G.[AccessAll] = 0 AND CG.[CollectionId] = C.[Id] AND CG.[GroupId] = GU.[GroupId]
|
[dbo].[CollectionGroup] CG ON G.[AccessAll] = 0 AND CG.[CollectionId] = C.[Id] AND CG.[GroupId] = GU.[GroupId]
|
||||||
WHERE
|
WHERE
|
||||||
OU.[UserId] = @UserId
|
OU.[UserId] = @UserId
|
||||||
|
AND OU.[Status] = 2 -- 2 = Confirmed
|
||||||
|
AND O.[Enabled] = 1
|
||||||
AND (
|
AND (
|
||||||
OU.[AccessAll] = 1
|
OU.[AccessAll] = 1
|
||||||
OR CU.[CollectionId] IS NOT NULL
|
OR CU.[CollectionId] IS NOT NULL
|
||||||
|
Reference in New Issue
Block a user