1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-22764] Fix Desktop footer button permissions (#15254)

* [PM-22764] Fix desktop footer button permissions

* [PM-22764] Fix desktop edit button permission

(cherry picked from commit 1b3877a3d2)
This commit is contained in:
Shane Melton
2025-06-18 16:53:13 -07:00
committed by Shane
parent 381f528c53
commit 747c2fd6a1
2 changed files with 3 additions and 5 deletions

View File

@@ -36,7 +36,7 @@
class="primary"
(click)="restore()"
appA11yTitle="{{ 'restore' | i18n }}"
*ngIf="cipher.isDeleted"
*ngIf="cipher.isDeleted && cipher.permissions.restore"
>
<i class="bwi bwi-undo bwi-fw bwi-lg" aria-hidden="true"></i>
</button>
@@ -50,7 +50,7 @@
<i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
</button>
</ng-container>
<div class="right" *ngIf="((canDeleteCipher$ | async) && action === 'edit') || action === 'view'">
<div class="right" *ngIf="cipher.permissions.delete && (action === 'edit' || action === 'view')">
<button
type="button"
(click)="delete()"

View File

@@ -1,6 +1,6 @@
import { CommonModule } from "@angular/common";
import { Input, Output, EventEmitter, Component, OnInit, ViewChild } from "@angular/core";
import { Observable, firstValueFrom } from "rxjs";
import { firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
@@ -32,7 +32,6 @@ export class ItemFooterComponent implements OnInit {
@Output() onCancel = new EventEmitter<CipherView>();
@ViewChild("submitBtn", { static: false }) submitBtn: ButtonComponent | null = null;
canDeleteCipher$: Observable<boolean> = new Observable();
activeUserId: UserId | null = null;
private passwordReprompted = false;
@@ -49,7 +48,6 @@ export class ItemFooterComponent implements OnInit {
) {}
async ngOnInit() {
this.canDeleteCipher$ = this.cipherAuthorizationService.canDeleteCipher$(this.cipher);
this.activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
}