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:
@ -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
|
Reference in New Issue
Block a user