1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +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>[]> =
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,
}));
}),
);