mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
owner check when editing
This commit is contained in:
parent
f1fc7832a0
commit
5187f4c15f
@ -243,7 +243,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
var confirmedOwners = (await GetConfirmedOwnersAsync(user.OrganizationId)).ToList();
|
||||
if(confirmedOwners.Count == 1 && confirmedOwners[0].Id == user.Id)
|
||||
if(user.Type != Enums.OrganizationUserType.Owner && confirmedOwners.Count == 1 && confirmedOwners[0].Id == user.Id)
|
||||
{
|
||||
throw new BadRequestException("Organization must have at least one confirmed owner.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user