mirror of
https://github.com/bitwarden/server.git
synced 2025-07-18 16:11:28 -05:00
support access all for collection user details
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
CREATE PROCEDURE [dbo].[Cipher_CanEditByIdUserId]
|
||||
CREATE PROCEDURE [dbo].[Cipher_ReadCanEditByIdUserId]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
|
@ -5,11 +5,9 @@ BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
CU.*
|
||||
*
|
||||
FROM
|
||||
[dbo].[CollectionUserCollectionDetailsView] CU
|
||||
INNER JOIN
|
||||
[OrganizationUser] OU ON CU.[OrganizationUserId] = OU.[Id]
|
||||
[dbo].[CollectionUserCollectionDetailsView]
|
||||
WHERE
|
||||
OU.[UserId] = @UserId
|
||||
[UserId] = @UserId
|
||||
END
|
@ -1,12 +1,18 @@
|
||||
CREATE VIEW [dbo].[CollectionUserCollectionDetailsView]
|
||||
AS
|
||||
SELECT
|
||||
CU.[Id],
|
||||
CU.[OrganizationUserId],
|
||||
S.[Name],
|
||||
S.[Id] CollectionId,
|
||||
CU.[ReadOnly]
|
||||
C.[Id] Id,
|
||||
C.[OrganizationId],
|
||||
C.[Name],
|
||||
OU.[UserId],
|
||||
OU.[Id] AS [OrganizationUserId],
|
||||
CASE WHEN OU.[AccessAll] = 0 AND CU.[ReadOnly] = 1 THEN 1 ELSE 0 END [ReadOnly]
|
||||
FROM
|
||||
[dbo].[CollectionUser] CU
|
||||
[dbo].[Collection] C
|
||||
INNER JOIN
|
||||
[dbo].[Collection] S ON S.[Id] = CU.[CollectionId]
|
||||
[dbo].[OrganizationUser] OU ON C.[OrganizationId] = OU.[OrganizationId]
|
||||
LEFT JOIN
|
||||
[dbo].[CollectionUser] CU ON OU.[AccessAll] = 0 AND CU.[CollectionId] = C.[Id] AND CU.[OrganizationUserId] = [OU].[Id]
|
||||
WHERE
|
||||
OU.[AccessAll] = 1
|
||||
OR CU.[Id] IS NOT NULL
|
Reference in New Issue
Block a user