mirror of
https://github.com/bitwarden/server
synced 2026-01-04 17:43:53 +00:00
reimport db after subvault => collection rename
This commit is contained in:
21
src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql
Normal file
21
src/Sql/dbo/Stored Procedures/Collection_ReadByUserId.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
CREATE PROCEDURE [dbo].[Collection_ReadByUserId]
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
S.*
|
||||
FROM
|
||||
[dbo].[CollectionView] S
|
||||
INNER JOIN
|
||||
[Organization] O ON O.[Id] = S.[OrganizationId]
|
||||
INNER JOIN
|
||||
[dbo].[OrganizationUser] OU ON OU.[OrganizationId] = O.[Id] AND OU.[UserId] = @UserId
|
||||
LEFT JOIN
|
||||
[dbo].[CollectionUser] SU ON OU.[AccessAllCollections] = 0 AND SU.[CollectionId] = S.[Id] AND SU.[OrganizationUserId] = OU.[Id]
|
||||
WHERE
|
||||
OU.[Status] = 2 -- Confirmed
|
||||
AND O.[Enabled] = 1
|
||||
AND (OU.[AccessAllCollections] = 1 OR SU.[CollectionId] IS NOT NULL)
|
||||
END
|
||||
Reference in New Issue
Block a user