mirror of
https://github.com/bitwarden/server
synced 2025-12-18 17:23:28 +00:00
owner check when editing
This commit is contained in:
@@ -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.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user