Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1f1b103
Adding new item to organization license
cd-bitwarden Oct 22, 2025
f2388e6
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Oct 22, 2025
763cc10
fixing whitespace issues
cd-bitwarden Oct 22, 2025
69b8586
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Oct 22, 2025
de5b797
fixing missing comment
cd-bitwarden Oct 22, 2025
7d4d0fd
Merge branch 'SM-1571-DisableSMAdsForUsers' of https://github.com/bitโ€ฆ
cd-bitwarden Oct 22, 2025
4e6b2de
fixing merge conflicts
cd-bitwarden Oct 22, 2025
3d51aac
merge fix
cd-bitwarden Oct 22, 2025
f319d7a
db merge fixes
cd-bitwarden Oct 22, 2025
9c5fce0
fix
cd-bitwarden Oct 22, 2025
7c930b7
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Oct 23, 2025
9baa22c
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Oct 23, 2025
7db2a84
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Oct 28, 2025
2bca8b1
Updating SM to Sm, and adding more view refreshes
cd-bitwarden Nov 6, 2025
363fa4f
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Nov 6, 2025
10b0465
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Nov 6, 2025
911be60
Merge branch 'SM-1571-DisableSMAdsForUsers' of https://github.com/bitโ€ฆ
cd-bitwarden Nov 6, 2025
036b2bd
Merge branch 'SM-1571-DisableSMAdsForUsers' of https://github.com/bitโ€ฆ
cd-bitwarden Nov 6, 2025
b8a14c9
fixing merge conflicts
cd-bitwarden Nov 6, 2025
17fad60
Redoing migration
cd-bitwarden Nov 26, 2025
fbf07ab
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 3, 2025
654cbc8
Update OrganizationLicense.cs
cd-bitwarden Dec 3, 2025
3fe93b5
Update OrganizationLicense.cs
cd-bitwarden Dec 3, 2025
f9d62ae
fixes
cd-bitwarden Dec 3, 2025
cad1c93
fixes
cd-bitwarden Dec 3, 2025
fd46c91
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 3, 2025
de81e4e
Merge branch 'SM-1571-DisableSMAdsForUsers' of https://github.com/bitโ€ฆ
cd-bitwarden Dec 3, 2025
eedd4c2
fixing db issues
cd-bitwarden Dec 3, 2025
e309d36
fix
cd-bitwarden Dec 3, 2025
6d8cc7f
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 3, 2025
126ca9f
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 4, 2025
fbb9b0d
rearranging sql after merge conflicts
cd-bitwarden Dec 9, 2025
42f83ec
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 9, 2025
e0bf292
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 10, 2025
b0342f5
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cturnbull-bitwarden Dec 18, 2025
17500ed
Merge conflicts with dbscripts are fixed, adding missing usedisableSMโ€ฆ
cd-bitwarden Dec 18, 2025
beef8e2
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 18, 2025
12a004b
removing incorrect merge fix
cd-bitwarden Dec 19, 2025
81f9985
Merge branch 'SM-1571-DisableSMAdsForUsers' of https://github.com/bitโ€ฆ
cd-bitwarden Dec 19, 2025
2c1701d
fixes
cd-bitwarden Dec 19, 2025
a97b82c
adding feature flag to disable sm ads
cd-bitwarden Dec 23, 2025
3fb4539
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 23, 2025
930c336
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 26, 2025
35185fa
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Dec 30, 2025
090f462
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Jan 2, 2026
5b59234
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Jan 7, 2026
b8860ca
Merge branch 'main' into SM-1571-DisableSMAdsForUsers
cd-bitwarden Jan 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ private void UpdateOrganization(Organization organization, OrganizationEditModel
organization.UseOrganizationDomains = model.UseOrganizationDomains;
organization.UseAdminSponsoredFamilies = model.UseAdminSponsoredFamilies;
organization.UseAutomaticUserConfirmation = model.UseAutomaticUserConfirmation;
organization.UseDisableSmAdsForUsers = model.UseDisableSmAdsForUsers;
organization.UsePhishingBlocker = model.UsePhishingBlocker;

//secrets
Expand Down
4 changes: 4 additions & 0 deletions src/Admin/AdminConsole/Models/OrganizationEditModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public OrganizationEditModel(
MaxAutoscaleSmServiceAccounts = org.MaxAutoscaleSmServiceAccounts;
UseOrganizationDomains = org.UseOrganizationDomains;
UseAutomaticUserConfirmation = org.UseAutomaticUserConfirmation;
UseDisableSmAdsForUsers = org.UseDisableSmAdsForUsers;
UsePhishingBlocker = org.UsePhishingBlocker;

_plans = plans;
Expand Down Expand Up @@ -196,6 +197,8 @@ public OrganizationEditModel(
public int? MaxAutoscaleSmServiceAccounts { get; set; }
[Display(Name = "Use Organization Domains")]
public bool UseOrganizationDomains { get; set; }
[Display(Name = "Disable SM Ads For Users")]
public new bool UseDisableSmAdsForUsers { get; set; }

[Display(Name = "Automatic User Confirmation")]
public bool UseAutomaticUserConfirmation { get; set; }
Expand Down Expand Up @@ -330,6 +333,7 @@ public Organization ToOrganization(Organization existingOrganization)
existingOrganization.SmServiceAccounts = SmServiceAccounts;
existingOrganization.MaxAutoscaleSmServiceAccounts = MaxAutoscaleSmServiceAccounts;
existingOrganization.UseOrganizationDomains = UseOrganizationDomains;
existingOrganization.UseDisableSmAdsForUsers = UseDisableSmAdsForUsers;
existingOrganization.UsePhishingBlocker = UsePhishingBlocker;
return existingOrganization;
}
Expand Down
1 change: 1 addition & 0 deletions src/Admin/AdminConsole/Models/OrganizationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public OrganizationViewModel(Organization org, Provider provider, IEnumerable<Or
public bool UseSecretsManager => Organization.UseSecretsManager;
public bool UseRiskInsights => Organization.UseRiskInsights;
public bool UsePhishingBlocker => Organization.UsePhishingBlocker;
public bool UseDisableSmAdsForUsers => Organization.UseDisableSmAdsForUsers;
public IEnumerable<OrganizationUserUserDetails> OwnersDetails { get; set; }
public IEnumerable<OrganizationUserUserDetails> AdminsDetails { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@
<input type="checkbox" class="form-check-input" asp-for="UseSecretsManager" disabled='@(canEditPlan ? null : "disabled")'>
<label class="form-check-label" asp-for="UseSecretsManager"></label>
</div>
@if (FeatureService.IsEnabled(FeatureFlagKeys.SM1719_RemoveSecretsManagerAds))
{
<div class="form-check">
<input type="checkbox" class="form-check-input" asp-for="UseDisableSmAdsForUsers" disabled='@(canEditPlan ? null : "disabled")'>
<label class="form-check-label" asp-for="UseDisableSmAdsForUsers"></label>
</div>
}
</div>
<div class="col-2">
<h3>Access Intelligence</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ protected BaseProfileOrganizationResponseModel(
UseAutomaticUserConfirmation = organizationDetails.UseAutomaticUserConfirmation;
UseSecretsManager = organizationDetails.UseSecretsManager;
UsePhishingBlocker = organizationDetails.UsePhishingBlocker;
UseDisableSMAdsForUsers = organizationDetails.UseDisableSMAdsForUsers;
UsePasswordManager = organizationDetails.UsePasswordManager;
SelfHost = organizationDetails.SelfHost;
Seats = organizationDetails.Seats;
Expand Down Expand Up @@ -100,6 +101,7 @@ protected BaseProfileOrganizationResponseModel(
public bool UseOrganizationDomains { get; set; }
public bool UseAdminSponsoredFamilies { get; set; }
public bool UseAutomaticUserConfirmation { get; set; }
public bool UseDisableSMAdsForUsers { get; set; }
public bool UsePhishingBlocker { get; set; }
public bool SelfHost { get; set; }
public int? Seats { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public OrganizationResponseModel(
UseOrganizationDomains = organization.UseOrganizationDomains;
UseAdminSponsoredFamilies = organization.UseAdminSponsoredFamilies;
UseAutomaticUserConfirmation = organization.UseAutomaticUserConfirmation;
UseDisableSmAdsForUsers = organization.UseDisableSmAdsForUsers;
UsePhishingBlocker = organization.UsePhishingBlocker;
}

Expand Down Expand Up @@ -124,6 +125,7 @@ public OrganizationResponseModel(
public bool UseOrganizationDomains { get; set; }
public bool UseAdminSponsoredFamilies { get; set; }
public bool UseAutomaticUserConfirmation { get; set; }
public bool UseDisableSmAdsForUsers { get; set; }
public bool UsePhishingBlocker { get; set; }
}

Expand Down
6 changes: 6 additions & 0 deletions src/Core/AdminConsole/Entities/Organization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ public class Organization : ITableObject<Guid>, IStorableSubscriber, IRevisable
/// </summary>
public bool UseAutomaticUserConfirmation { get; set; }

/// <summary>
/// If set to true, disables Secrets Manager ads for users in the organization
/// </summary>
public bool UseDisableSmAdsForUsers { get; set; }

/// <summary>
/// If set to true, the organization has phishing protection enabled.
/// </summary>
Expand Down Expand Up @@ -338,6 +343,7 @@ public void UpdateFromLicense(OrganizationLicense license, IFeatureService featu
UseRiskInsights = license.UseRiskInsights;
UseOrganizationDomains = license.UseOrganizationDomains;
UseAdminSponsoredFamilies = license.UseAdminSponsoredFamilies;
UseDisableSmAdsForUsers = license.UseDisableSmAdsForUsers;
UseAutomaticUserConfirmation = license.UseAutomaticUserConfirmation;
UsePhishingBlocker = license.UsePhishingBlocker;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ public interface IProfileOrganizationDetails
bool UseAdminSponsoredFamilies { get; set; }
bool UseOrganizationDomains { get; set; }
bool UseAutomaticUserConfirmation { get; set; }
bool UseDisableSMAdsForUsers { get; set; }

bool UsePhishingBlocker { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public class OrganizationUserOrganizationDetails : IProfileOrganizationDetails
public bool UseAdminSponsoredFamilies { get; set; }
public bool? IsAdminInitiated { get; set; }
public bool UseAutomaticUserConfirmation { get; set; }
public bool UseDisableSMAdsForUsers { get; set; }
public bool UsePhishingBlocker { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public Organization ToOrganization()
Status = Status,
UseRiskInsights = UseRiskInsights,
UseAdminSponsoredFamilies = UseAdminSponsoredFamilies,
UseDisableSmAdsForUsers = UseDisableSmAdsForUsers,
UsePhishingBlocker = UsePhishingBlocker,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ public class ProviderUserOrganizationDetails : IProfileOrganizationDetails
public string? SsoExternalId { get; set; }
public string? Permissions { get; set; }
public string? ResetPasswordKey { get; set; }
public bool UseDisableSMAdsForUsers { get; set; }
public bool UsePhishingBlocker { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public OrganizationAbility(Organization organization)
UseOrganizationDomains = organization.UseOrganizationDomains;
UseAdminSponsoredFamilies = organization.UseAdminSponsoredFamilies;
UseAutomaticUserConfirmation = organization.UseAutomaticUserConfirmation;
UseDisableSmAdsForUsers = organization.UseDisableSmAdsForUsers;
UsePhishingBlocker = organization.UsePhishingBlocker;
}

Expand All @@ -52,5 +53,6 @@ public OrganizationAbility(Organization organization)
public bool UseOrganizationDomains { get; set; }
public bool UseAdminSponsoredFamilies { get; set; }
public bool UseAutomaticUserConfirmation { get; set; }
public bool UseDisableSmAdsForUsers { get; set; }
public bool UsePhishingBlocker { get; set; }
}
3 changes: 3 additions & 0 deletions src/Core/AdminConsole/Services/OrganizationFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public static Organization Create(
UseAdminSponsoredFamilies =
claimsPrincipal.GetValue<bool>(OrganizationLicenseConstants.UseAdminSponsoredFamilies),
UseAutomaticUserConfirmation = claimsPrincipal.GetValue<bool>(OrganizationLicenseConstants.UseAutomaticUserConfirmation),
UseDisableSmAdsForUsers =
claimsPrincipal.GetValue<bool>(OrganizationLicenseConstants.UseDisableSmAdsForUsers),
UsePhishingBlocker = claimsPrincipal.GetValue<bool>(OrganizationLicenseConstants.UsePhishingBlocker),
};

Expand Down Expand Up @@ -113,6 +115,7 @@ public static Organization Create(
UseOrganizationDomains = license.UseOrganizationDomains,
UseAdminSponsoredFamilies = license.UseAdminSponsoredFamilies,
UseAutomaticUserConfirmation = license.UseAutomaticUserConfirmation,
UseDisableSmAdsForUsers = license.UseDisableSmAdsForUsers,
UsePhishingBlocker = license.UsePhishingBlocker,
};
}
1 change: 1 addition & 0 deletions src/Core/Billing/Licenses/LicenseConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static class OrganizationLicenseConstants
public const string UseAdminSponsoredFamilies = nameof(UseAdminSponsoredFamilies);
public const string UseOrganizationDomains = nameof(UseOrganizationDomains);
public const string UseAutomaticUserConfirmation = nameof(UseAutomaticUserConfirmation);
public const string UseDisableSmAdsForUsers = nameof(UseDisableSmAdsForUsers);
public const string UsePhishingBlocker = nameof(UsePhishingBlocker);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public Task<List<Claim>> GenerateClaims(Organization entity, LicenseContext lice
new(nameof(OrganizationLicenseConstants.UseAdminSponsoredFamilies), entity.UseAdminSponsoredFamilies.ToString()),
new(nameof(OrganizationLicenseConstants.UseOrganizationDomains), entity.UseOrganizationDomains.ToString()),
new(nameof(OrganizationLicenseConstants.UseAutomaticUserConfirmation), entity.UseAutomaticUserConfirmation.ToString()),
new(nameof(OrganizationLicenseConstants.UseDisableSmAdsForUsers), entity.UseDisableSmAdsForUsers.ToString()),
new(nameof(OrganizationLicenseConstants.UsePhishingBlocker), entity.UsePhishingBlocker.ToString()),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public OrganizationLicense(Organization org, SubscriptionInfo subscriptionInfo,
public bool UseOrganizationDomains { get; set; }
public bool UseAdminSponsoredFamilies { get; set; }
public bool UseAutomaticUserConfirmation { get; set; }
public bool UseDisableSmAdsForUsers { get; set; }
public string Hash { get; set; }
public string Signature { get; set; }
public string Token { get; set; }
Expand Down Expand Up @@ -230,6 +231,7 @@ public byte[] GetDataBytes(bool forHash = false)
!p.Name.Equals(nameof(UseAdminSponsoredFamilies)) &&
!p.Name.Equals(nameof(UseOrganizationDomains)) &&
!p.Name.Equals(nameof(UseAutomaticUserConfirmation)) &&
!p.Name.Equals(nameof(UseDisableSmAdsForUsers)) &&
!p.Name.Equals(nameof(UsePhishingBlocker)))
.OrderBy(p => p.Name)
.Select(p => $"{p.Name}:{Core.Utilities.CoreHelpers.FormatLicenseSignatureValue(p.GetValue(this, null))}")
Expand Down Expand Up @@ -425,6 +427,7 @@ public bool VerifyData(
var useAdminSponsoredFamilies = claimsPrincipal.GetValue<bool>(nameof(UseAdminSponsoredFamilies));
var useOrganizationDomains = claimsPrincipal.GetValue<bool>(nameof(UseOrganizationDomains));
var useAutomaticUserConfirmation = claimsPrincipal.GetValue<bool>(nameof(UseAutomaticUserConfirmation));
var useDisableSmAdsForUsers = claimsPrincipal.GetValue<bool>(nameof(UseDisableSmAdsForUsers));

var claimedPlanType = claimsPrincipal.GetValue<PlanType>(nameof(PlanType));

Expand Down Expand Up @@ -461,7 +464,8 @@ public bool VerifyData(
smServiceAccounts == organization.SmServiceAccounts &&
useAdminSponsoredFamilies == organization.UseAdminSponsoredFamilies &&
useOrganizationDomains == organization.UseOrganizationDomains &&
useAutomaticUserConfirmation == organization.UseAutomaticUserConfirmation;
useAutomaticUserConfirmation == organization.UseAutomaticUserConfirmation &&
useDisableSmAdsForUsers == organization.UseDisableSmAdsForUsers;

}

Expand Down
3 changes: 3 additions & 0 deletions src/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ public static class FeatureFlagKeys
/* UIF Team */
public const string RouterFocusManagement = "router-focus-management";

/* Secrets Manager Team */
public const string SM1719_RemoveSecretsManagerAds = "sm-1719-remove-secrets-manager-ads";

public static List<string> GetAllKeys()
{
return typeof(FeatureFlagKeys).GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public async Task<ICollection<OrganizationAbility>> GetManyAbilitiesAsync()
UseOrganizationDomains = e.UseOrganizationDomains,
UseAdminSponsoredFamilies = e.UseAdminSponsoredFamilies,
UseAutomaticUserConfirmation = e.UseAutomaticUserConfirmation,
UseDisableSmAdsForUsers = e.UseDisableSmAdsForUsers,
UsePhishingBlocker = e.UsePhishingBlocker
}).ToListAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ from os in os_g.DefaultIfEmpty()
IsAdminInitiated = os.IsAdminInitiated,
UseOrganizationDomains = o.UseOrganizationDomains,
UseAutomaticUserConfirmation = o.UseAutomaticUserConfirmation,
UseDisableSMAdsForUsers = o.UseDisableSmAdsForUsers,
UsePhishingBlocker = o.UsePhishingBlocker
};
return query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ from ss in ss_g.DefaultIfEmpty()
UseAutomaticUserConfirmation = x.o.UseAutomaticUserConfirmation,
SsoEnabled = x.ss.Enabled,
SsoConfig = x.ss.Data,
UseDisableSMAdsForUsers = x.o.UseDisableSmAdsForUsers,
UsePhishingBlocker = x.o.UsePhishingBlocker
});
}
Expand Down
9 changes: 6 additions & 3 deletions src/Sql/dbo/Stored Procedures/Organization_Create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ CREATE PROCEDURE [dbo].[Organization_Create]
@UseAdminSponsoredFamilies BIT = 0,
@SyncSeats BIT = 0,
@UseAutomaticUserConfirmation BIT = 0,
@UsePhishingBlocker BIT = 0
@UsePhishingBlocker BIT = 0,
@UseDisableSmAdsForUsers BIT = 0
AS
BEGIN
SET NOCOUNT ON
Expand Down Expand Up @@ -129,7 +130,8 @@ BEGIN
[SyncSeats],
[UseAutomaticUserConfirmation],
[UsePhishingBlocker],
[MaxStorageGbIncreased]
[MaxStorageGbIncreased],
[UseDisableSmAdsForUsers]
)
VALUES
(
Expand Down Expand Up @@ -195,6 +197,7 @@ BEGIN
@SyncSeats,
@UseAutomaticUserConfirmation,
@UsePhishingBlocker,
@MaxStorageGb
@MaxStorageGb,
@UseDisableSmAdsForUsers
);
END
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ BEGIN
[LimitItemDeletion],
[UseOrganizationDomains],
[UseAdminSponsoredFamilies],
[UseAutomaticUserConfirmation],
[UsePhishingBlocker]
[UseAutomaticUserConfirmation],
[UsePhishingBlocker],
[UseDisableSmAdsForUsers]
FROM
[dbo].[Organization]
END
6 changes: 4 additions & 2 deletions src/Sql/dbo/Stored Procedures/Organization_Update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ CREATE PROCEDURE [dbo].[Organization_Update]
@UseAdminSponsoredFamilies BIT = 0,
@SyncSeats BIT = 0,
@UseAutomaticUserConfirmation BIT = 0,
@UsePhishingBlocker BIT = 0
@UsePhishingBlocker BIT = 0,
@UseDisableSmAdsForUsers BIT = 0
AS
BEGIN
SET NOCOUNT ON
Expand Down Expand Up @@ -129,7 +130,8 @@ BEGIN
[SyncSeats] = @SyncSeats,
[UseAutomaticUserConfirmation] = @UseAutomaticUserConfirmation,
[UsePhishingBlocker] = @UsePhishingBlocker,
[MaxStorageGbIncreased] = @MaxStorageGb
[MaxStorageGbIncreased] = @MaxStorageGb,
[UseDisableSmAdsForUsers] = @UseDisableSmAdsForUsers
WHERE
[Id] = @Id;
END
1 change: 1 addition & 0 deletions src/Sql/dbo/Tables/Organization.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ CREATE TABLE [dbo].[Organization] (
[UseAutomaticUserConfirmation] BIT NOT NULL CONSTRAINT [DF_Organization_UseAutomaticUserConfirmation] DEFAULT (0),
[MaxStorageGbIncreased] SMALLINT NULL,
[UsePhishingBlocker] BIT NOT NULL CONSTRAINT [DF_Organization_UsePhishingBlocker] DEFAULT (0),
[UseDisableSmAdsForUsers] BIT NOT NULL CONSTRAINT [DF_Organization_UseDisableSmAdsForUsers] DEFAULT (0),
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ SELECT
O.[UseOrganizationDomains],
OS.[IsAdminInitiated],
O.[UseAutomaticUserConfirmation],
O.[UsePhishingBlocker]
O.[UsePhishingBlocker],
O.[UseDisableSmAdsForUsers]
FROM
[dbo].[OrganizationUser] OU
LEFT JOIN
Expand Down
3 changes: 2 additions & 1 deletion src/Sql/dbo/Views/OrganizationView.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ SELECT
[UseAdminSponsoredFamilies],
[SyncSeats],
[UseAutomaticUserConfirmation],
[UsePhishingBlocker]
[UsePhishingBlocker],
[UseDisableSmAdsForUsers]
FROM
[dbo].[Organization]
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ SELECT
O.[UseAutomaticUserConfirmation],
SS.[Enabled] SsoEnabled,
SS.[Data] SsoConfig,
O.[UsePhishingBlocker]
O.[UsePhishingBlocker],
O.[UseDisableSmAdsForUsers]
FROM
[dbo].[ProviderUser] PU
INNER JOIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void Constructor_ShouldPopulatePropertiesCorrectly(Organization organizat
UseCustomPermissions = organization.UseCustomPermissions,
UseRiskInsights = organization.UseRiskInsights,
UsePhishingBlocker = organization.UsePhishingBlocker,
UseDisableSMAdsForUsers = organization.UseDisableSmAdsForUsers,
UseOrganizationDomains = organization.UseOrganizationDomains,
UseAdminSponsoredFamilies = organization.UseAdminSponsoredFamilies,
UseAutomaticUserConfirmation = organization.UseAutomaticUserConfirmation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void Constructor_ShouldPopulatePropertiesCorrectly(Organization organizat
UseCustomPermissions = organization.UseCustomPermissions,
UseRiskInsights = organization.UseRiskInsights,
UsePhishingBlocker = organization.UsePhishingBlocker,
UseDisableSMAdsForUsers = organization.UseDisableSmAdsForUsers,
UseOrganizationDomains = organization.UseOrganizationDomains,
UseAdminSponsoredFamilies = organization.UseAdminSponsoredFamilies,
UseAutomaticUserConfirmation = organization.UseAutomaticUserConfirmation,
Expand Down
19 changes: 19 additions & 0 deletions test/Core.Test/AdminConsole/Entities/OrganizationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,23 @@ public void GetTwoFactorProviders_SavedWithName_Success()
var host = Assert.Contains("Host", (IDictionary<string, object>)duo.MetaData);
Assert.Equal("Host_value", host);
}

[Fact]
public void UseDisableSmAdsForUsers_DefaultValue_IsFalse()
{
var organization = new Organization();

Assert.False(organization.UseDisableSmAdsForUsers);
}

[Fact]
public void UseDisableSmAdsForUsers_CanBeSetToTrue()
{
var organization = new Organization
{
UseDisableSmAdsForUsers = true
};

Assert.True(organization.UseDisableSmAdsForUsers);
}
}
Loading
Loading