1
0
mirror of https://github.com/bitwarden/server synced 2026-01-10 20:44:05 +00:00

[PM 21897]Add Manual Enable/Disable Override for Providers in Admin Portal (#6072)

* Add the changes for the enable provider

* remove the wanted permission added

* Added a unit testing for the updateAsync
This commit is contained in:
cyprain-okeke
2025-07-24 16:12:25 +01:00
committed by GitHub
parent 2d1f914eae
commit 2cf7208eb3
8 changed files with 317 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ public class ProviderEditModel : ProviderViewModel, IValidatableObject
GatewaySubscriptionUrl = gatewaySubscriptionUrl;
Type = provider.Type;
PayByInvoice = payByInvoice;
Enabled = provider.Enabled;
if (Type == ProviderType.BusinessUnit)
{
@@ -78,10 +79,14 @@ public class ProviderEditModel : ProviderViewModel, IValidatableObject
[Display(Name = "Enterprise Seats Minimum")]
public int? EnterpriseMinimumSeats { get; set; }
[Display(Name = "Enabled")]
public bool Enabled { get; set; }
public virtual Provider ToProvider(Provider existingProvider)
{
existingProvider.BillingEmail = BillingEmail?.ToLowerInvariant().Trim();
existingProvider.BillingPhone = BillingPhone?.ToLowerInvariant().Trim();
existingProvider.Enabled = Enabled;
switch (Type)
{
case ProviderType.Msp: