1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-20 02:01:47 +01:00

[PM-14653] PM/AC Delete Cipher (#11996)

* check for admin console for unassigned ciphers

* use `isUnassigned` helper

* remove unneeded comment
This commit is contained in:
Nick Krantz 2024-11-14 14:22:17 -06:00 committed by GitHub
parent b0c5b5e9e6
commit d4a381e1bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -466,12 +466,11 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
* Helper method to delete cipher.
*/
private async deleteCipher(): Promise<void> {
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) {