mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 13:08:17 -05:00
Rearranged some things. Fixed the tests.
This commit is contained in:
parent
5f0d55b472
commit
58c3864601
@ -60,7 +60,8 @@ public class PostUserCommand(
|
||||
var request = model.ToRequest(
|
||||
scimProvider: scimProvider,
|
||||
inviteOrganization: new InviteOrganization(organization, plan),
|
||||
performedAt: timeProvider.GetUtcNow());
|
||||
performedAt: timeProvider.GetUtcNow(),
|
||||
hasSecretsManagerStandalone);
|
||||
|
||||
var orgUsers = await organizationUserRepository
|
||||
.GetManyDetailsByOrganizationAsync(request.InviteOrganization.OrganizationId);
|
||||
|
@ -34,16 +34,16 @@ public class InviteUsersPasswordManagerValidator(
|
||||
return new Valid<PasswordManagerSubscriptionUpdate>(subscriptionUpdate);
|
||||
}
|
||||
|
||||
if (subscriptionUpdate.SeatsRequiredToAdd == 0)
|
||||
{
|
||||
return new Valid<PasswordManagerSubscriptionUpdate>(subscriptionUpdate);
|
||||
}
|
||||
|
||||
if (subscriptionUpdate.PasswordManagerPlan.BaseSeats + subscriptionUpdate.SeatsRequiredToAdd <= 0)
|
||||
{
|
||||
return new Invalid<PasswordManagerSubscriptionUpdate>(new PasswordManagerMustHaveSeatsError(subscriptionUpdate));
|
||||
}
|
||||
|
||||
if (subscriptionUpdate.NewUsersToAdd == 0)
|
||||
{
|
||||
return new Valid<PasswordManagerSubscriptionUpdate>(subscriptionUpdate);
|
||||
}
|
||||
|
||||
if (subscriptionUpdate.MaxSeatsReached)
|
||||
{
|
||||
return new Invalid<PasswordManagerSubscriptionUpdate>(
|
||||
|
@ -75,7 +75,7 @@ public class InviteUsersPasswordManagerValidatorTests
|
||||
public async Task Validate_GivenThePlanDoesNotAllowAdditionalSeats_ShouldBeInvalidMessageOfPlanNotAllowingSeats(Organization organization,
|
||||
SutProvider<InviteUsersPasswordManagerValidator> sutProvider)
|
||||
{
|
||||
organization.Seats = 8;
|
||||
organization.Seats = 4;
|
||||
organization.MaxAutoscaleSeats = 9;
|
||||
var seatsOccupiedByUsers = 4;
|
||||
var additionalSeats = 4;
|
||||
|
Loading…
x
Reference in New Issue
Block a user