1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

[AC-1577] [AC-1575] Prefill Bitwarden portal values etc (#3155)

* [AC-1575] Don't overwrite existing org information when changing plans

* [AC-1577] Prefill SM configuration section when starting trial
This commit is contained in:
Thomas Rittson
2023-08-16 09:03:17 +10:00
committed by GitHub
parent 4ec01b0ef0
commit 60eab8a28e
8 changed files with 135 additions and 71 deletions

View File

@ -5,6 +5,7 @@ using Bit.Admin.Utilities;
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.OrganizationConnectionConfigs;
using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces;
using Bit.Core.Repositories;
@ -199,6 +200,14 @@ public class OrganizationsController : Controller
{
var organization = await GetOrganization(id, model);
if (organization.UseSecretsManager &&
!organization.SecretsManagerBeta
&& StaticStore.GetSecretsManagerPlan(organization.PlanType) == null
)
{
throw new BadRequestException("Plan does not support Secrets Manager");
}
await _organizationRepository.ReplaceAsync(organization);
await _applicationCacheService.UpsertOrganizationAbilityAsync(organization);
await _referenceEventService.RaiseEventAsync(new ReferenceEvent(ReferenceEventType.OrganizationEditedByAdmin, organization, _currentContext)