1
0
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:
Kyle Spearrin 2017-04-03 13:24:49 -04:00
parent f1fc7832a0
commit 5187f4c15f

View File

@ -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.");
}