mirror of
https://github.com/bitwarden/server.git
synced 2024-11-26 12:55:17 +01:00
org user remove fixes
This commit is contained in:
parent
9746bfb236
commit
2aa7c6cfe3
@ -797,6 +797,11 @@ namespace Bit.Core.Services
|
||||
throw new BadRequestException("User not valid.");
|
||||
}
|
||||
|
||||
if(orgUser.UserId == deletingUserId)
|
||||
{
|
||||
throw new BadRequestException("You cannot remove yourself.");
|
||||
}
|
||||
|
||||
var confirmedOwners = (await GetConfirmedOwnersAsync(organizationId)).ToList();
|
||||
if(confirmedOwners.Count == 1 && confirmedOwners[0].Id == organizationUserId)
|
||||
{
|
||||
|
@ -4,6 +4,12 @@ AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
DELETE
|
||||
FROM
|
||||
[dbo].[SubvaultUser]
|
||||
WHERE
|
||||
[OrganizationUserId] = @Id
|
||||
|
||||
DELETE
|
||||
FROM
|
||||
[dbo].[OrganizationUser]
|
||||
|
Loading…
Reference in New Issue
Block a user