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:
parent
423c062877
commit
93fd1c9c9a
@ -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.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user