mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +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:
@@ -10,12 +10,14 @@
|
||||
<ng-container slot="end">
|
||||
<bit-item-action>
|
||||
<app-download-attachment
|
||||
[admin]="!!organizationId"
|
||||
[cipher]="cipher"
|
||||
[attachment]="attachment"
|
||||
></app-download-attachment>
|
||||
</bit-item-action>
|
||||
<bit-item-action>
|
||||
<app-delete-attachment
|
||||
[admin]="!!organizationId"
|
||||
[cipherId]="cipher.id"
|
||||
[attachment]="attachment"
|
||||
(onDeletionSuccess)="removeAttachment(attachment)"
|
||||
|
||||
@@ -32,6 +32,7 @@ import { DeleteAttachmentComponent } from "./delete-attachment/delete-attachment
|
||||
class MockDownloadAttachmentComponent {
|
||||
@Input() attachment: AttachmentView;
|
||||
@Input() cipher: CipherView;
|
||||
@Input() admin: boolean = false;
|
||||
}
|
||||
|
||||
describe("CipherAttachmentsComponent", () => {
|
||||
|
||||
@@ -99,6 +99,7 @@ describe("DeleteAttachmentComponent", () => {
|
||||
"5555-444-3333",
|
||||
"222-3333-4444",
|
||||
"UserId",
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ export class DeleteAttachmentComponent {
|
||||
/** The attachment that is can be deleted */
|
||||
@Input({ required: true }) attachment!: AttachmentView;
|
||||
|
||||
/** Whether the attachemnt is being accessed from the admin console */
|
||||
@Input() admin: boolean = false;
|
||||
|
||||
/** Emits when the attachment is successfully deleted */
|
||||
@Output() onDeletionSuccess = new EventEmitter<void>();
|
||||
|
||||
@@ -66,6 +69,7 @@ export class DeleteAttachmentComponent {
|
||||
this.cipherId,
|
||||
this.attachment.id,
|
||||
activeUserId,
|
||||
this.admin,
|
||||
);
|
||||
|
||||
this.toastService.showToast({
|
||||
|
||||
Reference in New Issue
Block a user