mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-18 15:47:57 +01:00
delete ciphers as an admin when they're unassigned (#11930)
This commit is contained in:
parent
80c71c191b
commit
e87cc5896b
@ -466,7 +466,14 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
|
||||
* Helper method to delete cipher.
|
||||
*/
|
||||
private async deleteCipher(): Promise<void> {
|
||||
const asAdmin = this.organization?.canEditAllCiphers;
|
||||
const cipherIsUnassigned =
|
||||
!this.cipher.collectionIds || this.cipher.collectionIds?.length === 0;
|
||||
|
||||
// Delete the cipher as an admin when:
|
||||
// - 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) {
|
||||
await this.cipherService.deleteWithServer(this.cipher.id, asAdmin);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user