When redeeming a F4E sponsorship, now filtering out organizations that the current user is not an owner of (#10013)
This commit is contained in:
parent
3f0f5af26a
commit
dbeab65ea5
|
@ -6,6 +6,7 @@ import { first, map, takeUntil } from "rxjs/operators";
|
||||||
|
|
||||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
|
import { OrganizationUserType } from "@bitwarden/common/admin-console/enums";
|
||||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||||
import { OrganizationSponsorshipRedeemRequest } from "@bitwarden/common/admin-console/models/request/organization/organization-sponsorship-redeem.request";
|
import { OrganizationSponsorshipRedeemRequest } from "@bitwarden/common/admin-console/models/request/organization/organization-sponsorship-redeem.request";
|
||||||
import { PlanSponsorshipType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
import { PlanSponsorshipType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
||||||
|
@ -95,7 +96,12 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.existingFamilyOrganizations$ = this.organizationService.organizations$.pipe(
|
this.existingFamilyOrganizations$ = this.organizationService.organizations$.pipe(
|
||||||
map((orgs) => orgs.filter((o) => o.productTierType === ProductTierType.Families)),
|
map((orgs) =>
|
||||||
|
orgs.filter(
|
||||||
|
(o) =>
|
||||||
|
o.productTierType === ProductTierType.Families && o.type === OrganizationUserType.Owner,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.existingFamilyOrganizations$.pipe(takeUntil(this._destroy)).subscribe((orgs) => {
|
this.existingFamilyOrganizations$.pipe(takeUntil(this._destroy)).subscribe((orgs) => {
|
||||||
|
|
Loading…
Reference in New Issue