1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

Fix card filter restriction when user belongs to multiple orgs (#15521)

This commit is contained in:
SmithThe4th
2025-07-08 13:52:10 -04:00
committed by GitHub
parent b9f930a609
commit b92879a839

View File

@@ -266,15 +266,15 @@ export class VaultPopupListFiltersService {
readonly cipherTypes$: Observable<ChipSelectOption<CipherType>[]> = readonly cipherTypes$: Observable<ChipSelectOption<CipherType>[]> =
this.restrictedItemTypesService.restricted$.pipe( this.restrictedItemTypesService.restricted$.pipe(
map((restrictedTypes) => { map((restrictedTypes) => {
const restrictedCipherTypes = restrictedTypes.map((r) => r.cipherType); return CIPHER_MENU_ITEMS.filter((item) => {
const restriction = restrictedTypes.find((r) => r.cipherType === item.type);
return CIPHER_MENU_ITEMS.filter((item) => !restrictedCipherTypes.includes(item.type)).map( // Show if no restriction or if the restriction allows viewing in at least one org
(item) => ({ return !restriction || restriction.allowViewOrgIds.length > 0;
value: item.type, }).map((item) => ({
label: this.i18nService.t(item.labelKey), value: item.type,
icon: item.icon, label: this.i18nService.t(item.labelKey),
}), icon: item.icon,
); }));
}), }),
); );