1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-25 17:27:45 +01:00
bitwarden-server/util/Migrator/DbScripts/2023-05-03_00_ProviderUserReadByOrganizationIdStatus.sql
Rui Tomé 04e18ee8e7
[AC-621] Added possibility of adding users through SCIM to an Organization without a confirmed Owner (#2846)
* [AC-621] Added possibility of adding users through SCIM to an Organization without a confirmed Owner

* [AC-621] Passing EventSystemUser argument for HasConfirmedOwnersExceptAsync in user delete actions by SCIM

* [AC-624] Removed EventSystemUser parameter from IOrganizationService.HasConfirmedOwnersExceptAsync

* [AC-621] Added IProviderUserRepository.GetManyOrganizationDetailsByOrganizationAsync

* [AC-621] Updated OrganizationService.HasConfirmedOwnersExceptAsync to use IProviderUserRepository.GetManyOrganizationDetailsByOrganizationAsync to check for any confirmed provider users

* [AC-621] Removed unused EventSystemUser parameters

* [AC-621] Refactored ProviderUserRepository.GetManyByOrganizationAsync to return ProviderUser objects

* [AC-621] Removed default parameter value for Status
2023-05-17 16:39:08 +01:00

18 lines
446 B
Transact-SQL

CREATE OR ALTER PROCEDURE [dbo].[ProviderUser_ReadByOrganizationIdStatus]
@OrganizationId UNIQUEIDENTIFIER,
@Status TINYINT
AS
BEGIN
SET NOCOUNT ON
SELECT
PU.*
FROM
[dbo].[ProviderUserView] PU
INNER JOIN [dbo].[ProviderOrganizationView] as PO
ON PU.[ProviderId] = PO.[ProviderId]
WHERE
PO.[OrganizationId] = @OrganizationId
AND (@Status IS NULL OR PU.[Status] = @Status)
END
GO