mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +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:
@@ -36,7 +36,7 @@
|
|||||||
class="primary"
|
class="primary"
|
||||||
(click)="restore()"
|
(click)="restore()"
|
||||||
appA11yTitle="{{ 'restore' | i18n }}"
|
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>
|
<i class="bwi bwi-undo bwi-fw bwi-lg" aria-hidden="true"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
|
<i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
|
||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<div class="right" *ngIf="((canDeleteCipher$ | async) && action === 'edit') || action === 'view'">
|
<div class="right" *ngIf="cipher.permissions.delete && (action === 'edit' || action === 'view')">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
(click)="delete()"
|
(click)="delete()"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CommonModule } from "@angular/common";
|
import { CommonModule } from "@angular/common";
|
||||||
import { Input, Output, EventEmitter, Component, OnInit, ViewChild } from "@angular/core";
|
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 { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
@@ -32,7 +32,6 @@ export class ItemFooterComponent implements OnInit {
|
|||||||
@Output() onCancel = new EventEmitter<CipherView>();
|
@Output() onCancel = new EventEmitter<CipherView>();
|
||||||
@ViewChild("submitBtn", { static: false }) submitBtn: ButtonComponent | null = null;
|
@ViewChild("submitBtn", { static: false }) submitBtn: ButtonComponent | null = null;
|
||||||
|
|
||||||
canDeleteCipher$: Observable<boolean> = new Observable();
|
|
||||||
activeUserId: UserId | null = null;
|
activeUserId: UserId | null = null;
|
||||||
|
|
||||||
private passwordReprompted = false;
|
private passwordReprompted = false;
|
||||||
@@ -49,7 +48,6 @@ export class ItemFooterComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.canDeleteCipher$ = this.cipherAuthorizationService.canDeleteCipher$(this.cipher);
|
|
||||||
this.activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
this.activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user