From b92879a839263542a3b698040436144685b0691c Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Tue, 8 Jul 2025 13:52:10 -0400 Subject: [PATCH] Fix card filter restriction when user belongs to multiple orgs (#15521) --- .../vault-popup-list-filters.service.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts index 610b099952d..dde11aac5f7 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts @@ -266,15 +266,15 @@ export class VaultPopupListFiltersService { readonly cipherTypes$: Observable[]> = this.restrictedItemTypesService.restricted$.pipe( map((restrictedTypes) => { - const restrictedCipherTypes = restrictedTypes.map((r) => r.cipherType); - - return CIPHER_MENU_ITEMS.filter((item) => !restrictedCipherTypes.includes(item.type)).map( - (item) => ({ - value: item.type, - label: this.i18nService.t(item.labelKey), - icon: item.icon, - }), - ); + return CIPHER_MENU_ITEMS.filter((item) => { + const restriction = restrictedTypes.find((r) => r.cipherType === item.type); + // Show if no restriction or if the restriction allows viewing in at least one org + return !restriction || restriction.allowViewOrgIds.length > 0; + }).map((item) => ({ + value: item.type, + label: this.i18nService.t(item.labelKey), + icon: item.icon, + })); }), );