mirror of
https://github.com/bitwarden/server.git
synced 2025-07-16 23:27:30 -05:00
Bulk Confirm (#1345)
* Add support for bulk confirm * Add missing sproc to migration * Change ConfirmUserAsync to internally use ConfirmUsersAsync * Refactor to be a bit more readable * Change BulkReinvite and BulkRemove to return a list of errors/success * Refactor * Fix removing owner preventing removing non owners * Add another unit test * Use fixtures for OrganizationUser and Policies * Fix spelling
This commit is contained in:
@ -138,6 +138,7 @@
|
||||
<Build Include="dbo\Stored Procedures\User_BumpAccountRevisionDateByOrganizationUserIds.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_Delete.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_ReadPublicKeyById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_ReadPublicKeysByOrganizationUserIds.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_Move.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_UpdatePartial.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Device_ClearPushTokenById.sql" />
|
||||
@ -160,6 +161,7 @@
|
||||
<Build Include="dbo\Stored Procedures\Cipher_ReadCanEditByIdUserId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_Create.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_DeleteById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_DeleteDeleted.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_Update.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Device_Create.sql" />
|
||||
@ -174,6 +176,7 @@
|
||||
<Build Include="dbo\Stored Procedures\User_ReadByEmail.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Collection_UpdateWithGroups.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_ReadByIds.sql" />
|
||||
<Build Include="dbo\Stored Procedures\CollectionUser_Delete.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_Update.sql" />
|
||||
<Build Include="dbo\Stored Procedures\CollectionUser_ReadByCollectionId.sql" />
|
||||
|
18
src/Sql/dbo/Stored Procedures/User_ReadByIds.sql
Normal file
18
src/Sql/dbo/Stored Procedures/User_ReadByIds.sql
Normal file
@ -0,0 +1,18 @@
|
||||
CREATE PROCEDURE [dbo].[User_ReadByIds]
|
||||
@Ids AS [dbo].[GuidIdArray] READONLY
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
IF (SELECT COUNT(1) FROM @Ids) < 1
|
||||
BEGIN
|
||||
RETURN(-1)
|
||||
END
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[UserView]
|
||||
WHERE
|
||||
[Id] IN (SELECT [Id] FROM @Ids)
|
||||
END
|
@ -0,0 +1,19 @@
|
||||
CREATE PROCEDURE [dbo].[User_ReadPublicKeysByOrganizationUserIds]
|
||||
@OrganizationId UNIQUEIDENTIFIER,
|
||||
@OrganizationUserIds [dbo].[GuidIdArray] READONLY
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
OU.[Id],
|
||||
U.[PublicKey]
|
||||
FROM
|
||||
@OrganizationUserIds OUIDs
|
||||
INNER JOIN
|
||||
[dbo].[OrganizationUser] OU ON OUIDs.Id = OU.Id AND OU.[Status] = 1 -- Accepted
|
||||
INNER JOIN
|
||||
[dbo].[User] U ON OU.UserId = U.Id
|
||||
WHERE
|
||||
OU.OrganizationId = @OrganizationId
|
||||
END
|
Reference in New Issue
Block a user