1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-15 01:41:40 +01:00

Prevent sole owner from downgrading permissions (#1348)

This commit is contained in:
Thomas Rittson 2021-05-25 08:14:11 +10:00 committed by GitHub
parent 423c062877
commit 93fd1c9c9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1453,7 +1453,7 @@ namespace Bit.Core.Services
}
if (user.Type != OrganizationUserType.Owner &&
!await HasConfirmedOwnersExceptAsync(user.OrganizationId, Enumerable.Empty<Guid>()))
!await HasConfirmedOwnersExceptAsync(user.OrganizationId, new[] {user.Id}))
{
throw new BadRequestException("Organization must have at least one confirmed owner.");
}