mirror of
https://github.com/bitwarden/server.git
synced 2025-05-08 13:12:16 -05: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();
|
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.");
|
throw new BadRequestException("Organization must have at least one confirmed owner.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user