mirror of
https://github.com/bitwarden/server.git
synced 2024-11-29 13:25: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.");
|
throw new BadRequestException("User not valid.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(orgUser.UserId == deletingUserId)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("You cannot remove yourself.");
|
||||||
|
}
|
||||||
|
|
||||||
var confirmedOwners = (await GetConfirmedOwnersAsync(organizationId)).ToList();
|
var confirmedOwners = (await GetConfirmedOwnersAsync(organizationId)).ToList();
|
||||||
if(confirmedOwners.Count == 1 && confirmedOwners[0].Id == organizationUserId)
|
if(confirmedOwners.Count == 1 && confirmedOwners[0].Id == organizationUserId)
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,12 @@ AS
|
|||||||
BEGIN
|
BEGIN
|
||||||
SET NOCOUNT ON
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
[dbo].[SubvaultUser]
|
||||||
|
WHERE
|
||||||
|
[OrganizationUserId] = @Id
|
||||||
|
|
||||||
DELETE
|
DELETE
|
||||||
FROM
|
FROM
|
||||||
[dbo].[OrganizationUser]
|
[dbo].[OrganizationUser]
|
||||||
|
Loading…
Reference in New Issue
Block a user