mirror of
https://github.com/bitwarden/server.git
synced 2025-01-29 23:01:46 +01:00
Only test canScale is an org needs to scale for an invite (#1608)
This commit is contained in:
parent
182117e1b4
commit
9de9be8f20
@ -1072,10 +1072,13 @@ namespace Bit.Core.Services
|
||||
newSeatsRequired = invites.Sum(i => i.invite.Emails.Count()) - existingEmails.Count() - availableSeats;
|
||||
}
|
||||
|
||||
var (canScale, failureReason) = await CanScaleAsync(organization, newSeatsRequired);
|
||||
if (!canScale)
|
||||
if (newSeatsRequired > 0)
|
||||
{
|
||||
throw new BadRequestException(failureReason);
|
||||
var (canScale, failureReason) = await CanScaleAsync(organization, newSeatsRequired);
|
||||
if (!canScale)
|
||||
{
|
||||
throw new BadRequestException(failureReason);
|
||||
}
|
||||
}
|
||||
|
||||
var invitedAreAllOwners = invites.All(i => i.invite.Type == OrganizationUserType.Owner);
|
||||
@ -1465,11 +1468,6 @@ namespace Bit.Core.Services
|
||||
failureReason = "Cannot manage organization users.";
|
||||
return (false, failureReason);
|
||||
}
|
||||
// if (!await _currentContext.OrganizationOwner(organization.Id))
|
||||
// {
|
||||
// failureReason = "Only organization owners can autoscale seats.";
|
||||
// return (false, failureReason);
|
||||
// }
|
||||
|
||||
if (seatsToAdd < 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user