1
0
mirror of https://github.com/bitwarden/server synced 2025-12-28 14:13:48 +00:00

Group access & sproc/model refactoring.

This commit is contained in:
Kyle Spearrin
2017-05-11 10:32:25 -04:00
parent 76cebdd886
commit f0d7dc8023
26 changed files with 238 additions and 183 deletions

View File

@@ -35,11 +35,22 @@ BEGIN
[dbo].[OrganizationUser] OU ON OU.[OrganizationId] = O.[Id] AND OU.[UserId] = @UserId
LEFT JOIN
[dbo].[CollectionUser] CU ON OU.[AccessAll] = 0 AND CU.[CollectionId] = S.[Id] AND CU.[OrganizationUserId] = OU.[Id]
LEFT JOIN
[dbo].[GroupUser] GU ON CU.[CollectionId] IS NULL AND OU.[AccessAll] = 0 AND GU.[OrganizationUserId] = OU.[Id]
LEFT JOIN
[dbo].[Group] G ON G.[Id] = GU.[GroupId]
LEFT JOIN
[dbo].[CollectionGroup] CG ON G.[AccessAll] = 0 AND CG.[GroupId] = GU.[GroupId]
WHERE
O.[Id] = @OrganizationId
AND O.[Enabled] = 1
AND OU.[Status] = 2 -- Confirmed
AND (OU.[AccessAll] = 1 OR CU.[ReadOnly] = 0)
AND (
OU.[AccessAll] = 1
OR CU.[ReadOnly] = 0
OR G.[AccessAll] = 1
OR CG.[ReadOnly] = 0
)
)
INSERT INTO [dbo].[CollectionCipher]
(