mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 23:03:32 +00:00
don't allow 'except password' permissions to view or copy hidden fields (#12899)
This commit is contained in:
@@ -167,6 +167,10 @@ export class CustomFieldsComponent implements OnInit, AfterViewInit {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!this.cipherFormContainer.originalCipherView?.viewPassword) {
|
||||||
|
this.customFieldsForm.disable();
|
||||||
|
}
|
||||||
|
|
||||||
// Disable the form if in partial-edit mode
|
// Disable the form if in partial-edit mode
|
||||||
// Must happen after the initial fields are populated
|
// Must happen after the initial fields are populated
|
||||||
if (this.cipherFormContainer.config.mode === "partial-edit") {
|
if (this.cipherFormContainer.config.mode === "partial-edit") {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
bitIconButton
|
bitIconButton
|
||||||
bitPasswordInputToggle
|
bitPasswordInputToggle
|
||||||
|
*ngIf="canViewPassword"
|
||||||
(toggledChange)="logHiddenEvent($event)"
|
(toggledChange)="logHiddenEvent($event)"
|
||||||
></button>
|
></button>
|
||||||
<button
|
<button
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
[appCopyClick]="field.value"
|
[appCopyClick]="field.value"
|
||||||
showToast
|
showToast
|
||||||
[valueLabel]="field.name"
|
[valueLabel]="field.name"
|
||||||
|
*ngIf="canViewPassword"
|
||||||
[appA11yTitle]="'copyCustomField' | i18n: field.name"
|
[appA11yTitle]="'copyCustomField' | i18n: field.name"
|
||||||
(click)="logCopyEvent()"
|
(click)="logCopyEvent()"
|
||||||
></button>
|
></button>
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ export class CustomFieldV2Component implements OnInit {
|
|||||||
return this.i18nService.t(linkedType.i18nKey);
|
return this.i18nService.t(linkedType.i18nKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get canViewPassword() {
|
||||||
|
return this.cipher.viewPassword;
|
||||||
|
}
|
||||||
|
|
||||||
async logHiddenEvent(hiddenFieldVisible: boolean) {
|
async logHiddenEvent(hiddenFieldVisible: boolean) {
|
||||||
if (hiddenFieldVisible) {
|
if (hiddenFieldVisible) {
|
||||||
await this.eventCollectionService.collect(
|
await this.eventCollectionService.collect(
|
||||||
|
|||||||
Reference in New Issue
Block a user