mirror of
https://github.com/bitwarden/server.git
synced 2025-02-06 00:11:22 +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;
|
newSeatsRequired = invites.Sum(i => i.invite.Emails.Count()) - existingEmails.Count() - availableSeats;
|
||||||
}
|
}
|
||||||
|
|
||||||
var (canScale, failureReason) = await CanScaleAsync(organization, newSeatsRequired);
|
if (newSeatsRequired > 0)
|
||||||
if (!canScale)
|
|
||||||
{
|
{
|
||||||
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);
|
var invitedAreAllOwners = invites.All(i => i.invite.Type == OrganizationUserType.Owner);
|
||||||
@ -1465,11 +1468,6 @@ namespace Bit.Core.Services
|
|||||||
failureReason = "Cannot manage organization users.";
|
failureReason = "Cannot manage organization users.";
|
||||||
return (false, failureReason);
|
return (false, failureReason);
|
||||||
}
|
}
|
||||||
// if (!await _currentContext.OrganizationOwner(organization.Id))
|
|
||||||
// {
|
|
||||||
// failureReason = "Only organization owners can autoscale seats.";
|
|
||||||
// return (false, failureReason);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (seatsToAdd < 1)
|
if (seatsToAdd < 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user