mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00: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:
@@ -466,12 +466,11 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
|
|||||||
* Helper method to delete cipher.
|
* Helper method to delete cipher.
|
||||||
*/
|
*/
|
||||||
private async deleteCipher(): Promise<void> {
|
private async deleteCipher(): Promise<void> {
|
||||||
const cipherIsUnassigned =
|
const cipherIsUnassigned = this.cipher.isUnassigned;
|
||||||
!this.cipher.collectionIds || this.cipher.collectionIds?.length === 0;
|
|
||||||
|
|
||||||
// Delete the cipher as an admin when:
|
// Delete the cipher as an admin when:
|
||||||
// - the organization allows for owners/admins to manage all collections/items
|
// - The organization allows for owners/admins to manage all collections/items
|
||||||
// - the cipher is unassigned
|
// - The cipher is unassigned
|
||||||
const asAdmin = this.organization?.canEditAllCiphers || cipherIsUnassigned;
|
const asAdmin = this.organization?.canEditAllCiphers || cipherIsUnassigned;
|
||||||
|
|
||||||
if (this.cipher.isDeleted) {
|
if (this.cipher.isDeleted) {
|
||||||
|
|||||||
Reference in New Issue
Block a user