mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 09:02:48 -05:00
[AC-1828] [AC-1807] Aggregated admin panel pricing fixes (#3448)
* AC-1828: Allow reseller to add all teams and enterprise orgs * AC-1807: Only show provider-eligible plans on Organization edit * Thomas' feedback * Matt's feedback
This commit is contained in:
@ -96,12 +96,17 @@ public class OrganizationRepository : Repository<Core.Entities.Organization, Org
|
||||
public async Task<ICollection<Core.Entities.Organization>> SearchUnassignedToProviderAsync(string name, string ownerEmail, int skip, int take)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
var dbContext = GetDatabaseContext(scope);
|
||||
var query = from o in dbContext.Organizations
|
||||
where o.PlanType >= PlanType.TeamsMonthly2020 && o.PlanType <= PlanType.EnterpriseAnnually &&
|
||||
!dbContext.ProviderOrganizations.Any(po => po.OrganizationId == o.Id) &&
|
||||
(string.IsNullOrWhiteSpace(name) || EF.Functions.Like(o.Name, $"%{name}%"))
|
||||
select o;
|
||||
|
||||
var query =
|
||||
from o in dbContext.Organizations
|
||||
where
|
||||
((o.PlanType >= PlanType.TeamsMonthly2019 && o.PlanType <= PlanType.EnterpriseAnnually2019) ||
|
||||
(o.PlanType >= PlanType.TeamsMonthly2020 && o.PlanType <= PlanType.EnterpriseAnnually)) &&
|
||||
!dbContext.ProviderOrganizations.Any(po => po.OrganizationId == o.Id) &&
|
||||
(string.IsNullOrWhiteSpace(name) || EF.Functions.Like(o.Name, $"%{name}%"))
|
||||
select o;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(ownerEmail))
|
||||
{
|
||||
|
Reference in New Issue
Block a user