Set search index for limited collection org users (#983)
This commit is contained in:
parent
45c31aa089
commit
1c5ce23d35
|
@ -42,12 +42,12 @@ export class CiphersComponent extends BaseCiphersComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
async load(filter: (cipher: CipherView) => boolean = null) {
|
async load(filter: (cipher: CipherView) => boolean = null) {
|
||||||
if (!this.organization.canManageAllCollections) {
|
if (this.organization.canManageAllCollections) {
|
||||||
await super.load(filter, this.deleted);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.accessEvents = this.organization.useEvents;
|
this.accessEvents = this.organization.useEvents;
|
||||||
this.allCiphers = await this.cipherService.getAllFromApiForOrganization(this.organization.id);
|
this.allCiphers = await this.cipherService.getAllFromApiForOrganization(this.organization.id);
|
||||||
|
} else {
|
||||||
|
this.allCiphers = (await this.cipherService.getAllDecrypted()).filter(c => c.organizationId === this.organization.id);
|
||||||
|
}
|
||||||
await this.searchService.indexCiphers(this.organization.id, this.allCiphers);
|
await this.searchService.indexCiphers(this.organization.id, this.allCiphers);
|
||||||
await this.applyFilter(filter);
|
await this.applyFilter(filter);
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
@ -63,7 +63,7 @@ export class CiphersComponent extends BaseCiphersComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
async search(timeout: number = null) {
|
async search(timeout: number = null) {
|
||||||
super.search(timeout, this.allCiphers);
|
await super.search(timeout, this.allCiphers);
|
||||||
}
|
}
|
||||||
events(c: CipherView) {
|
events(c: CipherView) {
|
||||||
this.onEventsClicked.emit(c);
|
this.onEventsClicked.emit(c);
|
||||||
|
|
Loading…
Reference in New Issue