1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-05 03:32:21 -05:00
bitwarden/src/Sql/dbo/Stored Procedures/OrganizationUser_ReadWithCollectionsById.sql

19 lines
460 B
Transact-SQL

CREATE PROCEDURE [dbo].[OrganizationUser_ReadWithCollectionsById]
@Id UNIQUEIDENTIFIER
AS
BEGIN
SET NOCOUNT ON
EXEC [OrganizationUser_ReadById] @Id
SELECT
CU.[CollectionId] Id,
CU.[ReadOnly],
CU.[HidePasswords]
FROM
[dbo].[OrganizationUser] OU
INNER JOIN
[dbo].[CollectionUser] CU ON OU.[AccessAll] = 0 AND CU.[OrganizationUserId] = [OU].[Id]
WHERE
[OrganizationUserId] = @Id
END