1
0
mirror of https://github.com/bitwarden/server synced 2026-03-02 11:21:31 +00:00

[PM-29498] Remove Premium Feature Flagged Logic (#6967)

* Remove feature flag logic and fix unit tests

* Simplify query

* Fix test

* Fix local review
This commit is contained in:
sven-bitwarden
2026-02-19 08:06:17 -06:00
committed by GitHub
parent cfd5bedae0
commit 4d91350fb7
5 changed files with 60 additions and 312 deletions

View File

@@ -12,6 +12,7 @@ using Bit.Core.Auth.Enums;
using Bit.Core.Auth.Models;
using Bit.Core.Auth.UserFeatures.TwoFactorAuth.Interfaces;
using Bit.Core.Billing.Models.Business;
using Bit.Core.Billing.Premium.Queries;
using Bit.Core.Billing.Services;
using Bit.Core.Entities;
using Bit.Core.Enums;
@@ -113,11 +114,11 @@ public class UserServiceTests
{
orgUser.OrganizationId = organization.Id;
organization.Enabled = true;
organization.UsersGetPremium = true;
var orgAbilities = new Dictionary<Guid, OrganizationAbility>() { { organization.Id, new OrganizationAbility(organization) } };
sutProvider.GetDependency<IOrganizationUserRepository>().GetManyByUserAsync(user.Id).Returns(new List<OrganizationUser>() { orgUser });
sutProvider.GetDependency<IApplicationCacheService>().GetOrganizationAbilitiesAsync().Returns(orgAbilities);
sutProvider.GetDependency<IHasPremiumAccessQuery>().HasPremiumFromOrganizationAsync(user.Id).Returns(true);
Assert.True(await sutProvider.Sut.HasPremiumFromOrganization(user));
}