diff --git a/src/Admin/AdminConsole/Models/OrganizationEditModel.cs b/src/Admin/AdminConsole/Models/OrganizationEditModel.cs index 5fdd2bcc3..56782e695 100644 --- a/src/Admin/AdminConsole/Models/OrganizationEditModel.cs +++ b/src/Admin/AdminConsole/Models/OrganizationEditModel.cs @@ -179,13 +179,69 @@ public class OrganizationEditModel : OrganizationViewModel * This is mapped manually below to provide some type safety in case the plan objects change * Add mappings for individual properties as you need them */ - public IEnumerable> GetPlansHelper() => + public object GetPlansHelper() => StaticStore.Plans .Where(p => p.SupportsSecretsManager) - .Select(p => new Dictionary + .Select(p => { - { "type", p.Type }, - { "baseServiceAccount", p.SecretsManager.BaseServiceAccount } + var plan = new + { + Type = p.Type, + Has2fa = p.Has2fa, + HasApi = p.HasApi, + HasGroups = p.HasGroups, + HasPolicies = p.HasPolicies, + HasSso = p.HasSso, + HasScim = p.HasScim, + HasDirectory = p.HasDirectory, + HasEvents = p.HasEvents, + HasResetPassword = p.HasResetPassword, + HasCustomPermissions = p.HasCustomPermissions, + PasswordManager = + new + { + StripePlanId = p.PasswordManager?.StripePlanId, + StripeSeatPlanId = p.PasswordManager?.StripeSeatPlanId, + StripeProviderPortalSeatPlanId = p.PasswordManager?.StripeProviderPortalSeatPlanId, + BasePrice = p.PasswordManager?.BasePrice, + SeatPrice = p.PasswordManager?.SeatPrice, + ProviderPortalSeatPrice = p.PasswordManager?.ProviderPortalSeatPrice, + AllowSeatAutoscale = p.PasswordManager?.AllowSeatAutoscale, + HasAdditionalSeatsOption = p.PasswordManager?.HasAdditionalSeatsOption, + MaxAdditionalSeats = p.PasswordManager?.MaxAdditionalSeats, + BaseSeats = p.PasswordManager?.BaseSeats, + HasPremiumAccessOption = p.PasswordManager?.HasPremiumAccessOption, + StripePremiumAccessPlanId = p.PasswordManager?.StripePremiumAccessPlanId, + PremiumAccessOptionPrice = p.PasswordManager?.PremiumAccessOptionPrice, + MaxSeats = p.PasswordManager?.MaxSeats, + BaseStorageGb = p.PasswordManager?.BaseStorageGb, + HasAdditionalStorageOption = p.PasswordManager?.HasAdditionalStorageOption, + AdditionalStoragePricePerGb = p.PasswordManager?.AdditionalStoragePricePerGb, + StripeStoragePlanId = p.PasswordManager?.StripeStoragePlanId, + MaxAdditionalStorage = p.PasswordManager?.MaxAdditionalStorage, + MaxCollections = p.PasswordManager?.MaxCollections + }, + SecretsManager = new + { + MaxServiceAccounts = p.SecretsManager?.MaxServiceAccounts, + AllowServiceAccountsAutoscale = p.SecretsManager?.AllowServiceAccountsAutoscale, + StripeServiceAccountPlanId = p.SecretsManager?.StripeServiceAccountPlanId, + AdditionalPricePerServiceAccount = p.SecretsManager?.AdditionalPricePerServiceAccount, + BaseServiceAccount = p.SecretsManager?.BaseServiceAccount, + MaxAdditionalServiceAccount = p.SecretsManager?.MaxAdditionalServiceAccount, + HasAdditionalServiceAccountOption = p.SecretsManager?.HasAdditionalServiceAccountOption, + StripeSeatPlanId = p.SecretsManager?.StripeSeatPlanId, + HasAdditionalSeatsOption = p.SecretsManager?.HasAdditionalSeatsOption, + BasePrice = p.SecretsManager?.BasePrice, + SeatPrice = p.SecretsManager?.SeatPrice, + BaseSeats = p.SecretsManager?.BaseSeats, + MaxSeats = p.SecretsManager?.MaxSeats, + MaxAdditionalSeats = p.SecretsManager?.MaxAdditionalSeats, + AllowSeatAutoscale = p.SecretsManager?.AllowSeatAutoscale, + MaxProjects = p.SecretsManager?.MaxProjects + } + }; + return plan; }); public Organization CreateOrganization(Provider provider, bool flexibleCollectionsV1Enabled) diff --git a/src/Admin/AdminConsole/Views/Shared/_OrganizationFormScripts.cshtml b/src/Admin/AdminConsole/Views/Shared/_OrganizationFormScripts.cshtml index 5e0b938da..4dd3c6e27 100644 --- a/src/Admin/AdminConsole/Views/Shared/_OrganizationFormScripts.cshtml +++ b/src/Admin/AdminConsole/Views/Shared/_OrganizationFormScripts.cshtml @@ -2,6 +2,7 @@ @using Bit.Admin.Utilities @using Bit.Core.Billing.Enums @using Bit.Core.Enums +@using Bit.Core.Utilities @model OrganizationEditModel