From d4a381e1bd2fd1f4be8c5a829337514d1e9c7007 Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:22:17 -0600 Subject: [PATCH] [PM-14653] PM/AC Delete Cipher (#11996) * check for admin console for unassigned ciphers * use `isUnassigned` helper * remove unneeded comment --- .../vault-item-dialog/vault-item-dialog.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index df575cc525..2742cd52ef 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -466,12 +466,11 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { * Helper method to delete cipher. */ private async deleteCipher(): Promise { - const cipherIsUnassigned = - !this.cipher.collectionIds || this.cipher.collectionIds?.length === 0; + const cipherIsUnassigned = this.cipher.isUnassigned; // Delete the cipher as an admin when: - // - the organization allows for owners/admins to manage all collections/items - // - the cipher is unassigned + // - The organization allows for owners/admins to manage all collections/items + // - The cipher is unassigned const asAdmin = this.organization?.canEditAllCiphers || cipherIsUnassigned; if (this.cipher.isDeleted) {