mirror of
https://github.com/bitwarden/server
synced 2026-01-04 09:33:40 +00:00
support access all for collection user details
This commit is contained in:
@@ -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