mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
[PM-19383] admins unable to download attachments (#14363)
* add admin support for downloading attachments * fix delete and upload * fix delete admin to return a response * fix upload * add missing param * use getCipherAdmin * fix cli
This commit is contained in:
@@ -460,14 +460,29 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
|
||||
const activeUserId = await firstValueFrom(
|
||||
this.accountService.activeAccount$.pipe(map((a) => a?.id)),
|
||||
);
|
||||
const updatedCipher = await this.cipherService.get(
|
||||
this.formConfig.originalCipher?.id,
|
||||
activeUserId,
|
||||
);
|
||||
|
||||
const updatedCipherView = await updatedCipher.decrypt(
|
||||
await this.cipherService.getKeyForCipherKeyDecryption(updatedCipher, activeUserId),
|
||||
);
|
||||
let updatedCipherView: CipherView;
|
||||
|
||||
if (this.formConfig.admin) {
|
||||
const cipherResponse = await this.apiService.getCipherAdmin(
|
||||
this.formConfig.originalCipher?.id,
|
||||
);
|
||||
const cipherData = new CipherData(cipherResponse);
|
||||
const cipher = new Cipher(cipherData);
|
||||
|
||||
updatedCipherView = await cipher.decrypt(
|
||||
await this.cipherService.getKeyForCipherKeyDecryption(cipher, activeUserId),
|
||||
);
|
||||
} else {
|
||||
const updatedCipher = await this.cipherService.get(
|
||||
this.formConfig.originalCipher?.id,
|
||||
activeUserId,
|
||||
);
|
||||
|
||||
updatedCipherView = await updatedCipher.decrypt(
|
||||
await this.cipherService.getKeyForCipherKeyDecryption(updatedCipher, activeUserId),
|
||||
);
|
||||
}
|
||||
|
||||
this.cipherFormComponent.patchCipher((currentCipher) => {
|
||||
currentCipher.attachments = updatedCipherView.attachments;
|
||||
|
||||
Reference in New Issue
Block a user