mirror of
https://github.com/bitwarden/browser
synced 2026-02-06 03:33:30 +00:00
update all org reports to get permission data from cached ciphers
This commit is contained in:
@@ -91,8 +91,23 @@ export class ExposedPasswordsReportComponent
|
||||
});
|
||||
}
|
||||
|
||||
getAllCiphers(): Promise<CipherView[]> {
|
||||
return this.cipherService.getAllFromApiForOrganization(this.organization.id, true);
|
||||
async getAllCiphers(): Promise<CipherView[]> {
|
||||
const orgCiphers = await this.cipherService.getAllFromApiForOrganization(
|
||||
this.organization.id,
|
||||
true,
|
||||
);
|
||||
|
||||
// response from API above does not include permission levels for ciphers. look up ciphers in cache and use current user's permissions where possible
|
||||
orgCiphers.map((cipher) => {
|
||||
const editable = this.manageableCiphers.find((c) => c.id === cipher.id);
|
||||
if (editable) {
|
||||
cipher.edit = editable.edit;
|
||||
cipher.viewPassword = editable.viewPassword;
|
||||
cipher.permissions = editable.permissions;
|
||||
}
|
||||
});
|
||||
|
||||
return orgCiphers;
|
||||
}
|
||||
|
||||
canManageCipher(c: CipherView): boolean {
|
||||
|
||||
@@ -98,7 +98,22 @@ export class InactiveTwoFactorReportComponent
|
||||
|
||||
async getAllCiphers(): Promise<CipherView[]> {
|
||||
if (this.organization) {
|
||||
return await this.cipherService.getAllFromApiForOrganization(this.organization.id, true);
|
||||
const orgCiphers = await this.cipherService.getAllFromApiForOrganization(
|
||||
this.organization.id,
|
||||
true,
|
||||
);
|
||||
|
||||
// response from API above does not include permission levels for ciphers. look up ciphers in cache and use current user's permissions where possible
|
||||
orgCiphers.map((cipher) => {
|
||||
const editable = this.manageableCiphers.find((c) => c.id === cipher.id);
|
||||
if (editable) {
|
||||
cipher.edit = editable.edit;
|
||||
cipher.viewPassword = editable.viewPassword;
|
||||
cipher.permissions = editable.permissions;
|
||||
}
|
||||
});
|
||||
|
||||
return orgCiphers;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -89,8 +89,23 @@ export class ReusedPasswordsReportComponent
|
||||
});
|
||||
}
|
||||
|
||||
getAllCiphers(): Promise<CipherView[]> {
|
||||
return this.cipherService.getAllFromApiForOrganization(this.organization.id, true);
|
||||
async getAllCiphers(): Promise<CipherView[]> {
|
||||
const orgCiphers = await this.cipherService.getAllFromApiForOrganization(
|
||||
this.organization.id,
|
||||
true,
|
||||
);
|
||||
|
||||
// response from API above does not include permission levels for ciphers. look up ciphers in cache and use current user's permissions where possible
|
||||
orgCiphers.map((cipher) => {
|
||||
const editable = this.manageableCiphers.find((c) => c.id === cipher.id);
|
||||
if (editable) {
|
||||
cipher.edit = editable.edit;
|
||||
cipher.viewPassword = editable.viewPassword;
|
||||
cipher.permissions = editable.permissions;
|
||||
}
|
||||
});
|
||||
|
||||
return orgCiphers;
|
||||
}
|
||||
|
||||
canManageCipher(c: CipherView): boolean {
|
||||
|
||||
@@ -94,8 +94,23 @@ export class UnsecuredWebsitesReportComponent
|
||||
});
|
||||
}
|
||||
|
||||
getAllCiphers(): Promise<CipherView[]> {
|
||||
return this.cipherService.getAllFromApiForOrganization(this.organization.id, true);
|
||||
async getAllCiphers(): Promise<CipherView[]> {
|
||||
const orgCiphers = await this.cipherService.getAllFromApiForOrganization(
|
||||
this.organization.id,
|
||||
true,
|
||||
);
|
||||
|
||||
// response from API above does not include permission levels for ciphers. look up ciphers in cache and use current user's permissions where possible
|
||||
orgCiphers.map((cipher) => {
|
||||
const editable = this.manageableCiphers.find((c) => c.id === cipher.id);
|
||||
if (editable) {
|
||||
cipher.edit = editable.edit;
|
||||
cipher.viewPassword = editable.viewPassword;
|
||||
cipher.permissions = editable.permissions;
|
||||
}
|
||||
});
|
||||
|
||||
return orgCiphers;
|
||||
}
|
||||
|
||||
protected canManageCipher(c: CipherView): boolean {
|
||||
|
||||
@@ -93,8 +93,23 @@ export class WeakPasswordsReportComponent
|
||||
});
|
||||
}
|
||||
|
||||
getAllCiphers(): Promise<CipherView[]> {
|
||||
return this.cipherService.getAllFromApiForOrganization(this.organization.id, true);
|
||||
async getAllCiphers(): Promise<CipherView[]> {
|
||||
const orgCiphers = await this.cipherService.getAllFromApiForOrganization(
|
||||
this.organization.id,
|
||||
true,
|
||||
);
|
||||
|
||||
// response from API above does not include permission levels for ciphers. look up ciphers in cache and use current user's permissions where possible
|
||||
orgCiphers.map((cipher) => {
|
||||
const editable = this.manageableCiphers.find((c) => c.id === cipher.id);
|
||||
if (editable) {
|
||||
cipher.edit = editable.edit;
|
||||
cipher.viewPassword = editable.viewPassword;
|
||||
cipher.permissions = editable.permissions;
|
||||
}
|
||||
});
|
||||
|
||||
return orgCiphers;
|
||||
}
|
||||
|
||||
canManageCipher(c: CipherView): boolean {
|
||||
|
||||
Reference in New Issue
Block a user