mirror of
https://github.com/bitwarden/server.git
synced 2024-11-23 12:25:16 +01:00
23 lines
501 B
Transact-SQL
23 lines
501 B
Transact-SQL
IF OBJECT_ID('[dbo].[OrganizationUser_ReadByMinimumRole]') IS NOT NULL
|
|
BEGIN
|
|
DROP PROCEDURE [dbo].[OrganizationUser_ReadByMinimumRole]
|
|
END
|
|
GO
|
|
|
|
CREATE PROCEDURE [dbo].[OrganizationUser_ReadByMinimumRole]
|
|
@OrganizationId UNIQUEIDENTIFIER,
|
|
@MinRole TINYINT
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
SELECT
|
|
*
|
|
FROM
|
|
[dbo].[OrganizationUserUserDetailsView]
|
|
WHERE
|
|
OrganizationId = @OrganizationId
|
|
AND Status = 2 -- 2 = Confirmed
|
|
AND [Type] <= @MinRole
|
|
END
|