1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-13 05:38:25 -05:00

return collection readonly details

This commit is contained in:
Kyle Spearrin
2018-06-11 14:25:53 -04:00
parent 9cf036227e
commit 74874a1c38
10 changed files with 108 additions and 27 deletions

View File

@ -1,12 +1,20 @@
CREATE PROCEDURE [dbo].[Collection_ReadByUserId]
@UserId UNIQUEIDENTIFIER,
@WriteOnly BIT
@UserId UNIQUEIDENTIFIER
AS
BEGIN
SET NOCOUNT ON
SELECT
C.*
C.*,
CASE
WHEN
OU.[AccessAll] = 1
OR G.[AccessAll] = 1
OR CU.[ReadOnly] = 0
OR CG.[ReadOnly] = 0
THEN 1
ELSE 0
END [ReadOnly]
FROM
[dbo].[CollectionView] C
INNER JOIN
@ -31,11 +39,4 @@ BEGIN
OR G.[AccessAll] = 1
OR CG.[CollectionId] IS NOT NULL
)
AND (
@WriteOnly = 0
OR OU.[AccessAll] = 1
OR G.[AccessAll] = 1
OR CU.[ReadOnly] = 0
OR CG.[ReadOnly] = 0
)
END