mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
validate edit access when opening view form
This commit is contained in:
@@ -896,16 +896,22 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
cipher?.type,
|
cipher?.type,
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.openVaultItemDialog("view", cipherFormConfig);
|
await this.openVaultItemDialog("view", cipherFormConfig, cipher);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the combined view / edit dialog for a cipher.
|
* Open the combined view / edit dialog for a cipher.
|
||||||
*/
|
*/
|
||||||
async openVaultItemDialog(mode: VaultItemDialogMode, formConfig: CipherFormConfig) {
|
async openVaultItemDialog(
|
||||||
|
mode: VaultItemDialogMode,
|
||||||
|
formConfig: CipherFormConfig,
|
||||||
|
cipher?: CipherView,
|
||||||
|
) {
|
||||||
|
const disableForm = cipher ? !cipher.edit && !this.organization.canEditAllCiphers : false;
|
||||||
this.vaultItemDialogRef = VaultItemDialogComponent.open(this.dialogService, {
|
this.vaultItemDialogRef = VaultItemDialogComponent.open(this.dialogService, {
|
||||||
mode,
|
mode,
|
||||||
formConfig,
|
formConfig,
|
||||||
|
disableForm,
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await lastValueFrom(this.vaultItemDialogRef.closed);
|
const result = await lastValueFrom(this.vaultItemDialogRef.closed);
|
||||||
|
|||||||
Reference in New Issue
Block a user