mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-15938] - Restrict viewing hidden input based on permission (#13016)
* allow string or boolean disabled prop in input directive * fix tests * add test * disable custom fields in partial edit * disable custom fields in partial edit * manually disable inputs * revert changes to directive * revert other changes * remove unnecessary check for partial-edit
This commit is contained in:
@@ -158,20 +158,23 @@ export class CustomFieldsComponent implements OnInit, AfterViewInit {
|
||||
value = field.value === "true" ? true : false;
|
||||
}
|
||||
|
||||
this.fields.push(
|
||||
this.formBuilder.group<CustomField>({
|
||||
type: field.type,
|
||||
name: field.name,
|
||||
value: value,
|
||||
linkedId: field.linkedId,
|
||||
newField: false,
|
||||
}),
|
||||
);
|
||||
});
|
||||
const customField = this.formBuilder.group<CustomField>({
|
||||
type: field.type,
|
||||
name: field.name,
|
||||
value: value,
|
||||
linkedId: field.linkedId,
|
||||
newField: false,
|
||||
});
|
||||
|
||||
if (!this.cipherFormContainer.originalCipherView?.viewPassword) {
|
||||
this.customFieldsForm.disable();
|
||||
}
|
||||
if (
|
||||
field.type === FieldType.Hidden &&
|
||||
!this.cipherFormContainer.originalCipherView?.viewPassword
|
||||
) {
|
||||
customField.controls.value.disable();
|
||||
}
|
||||
|
||||
this.fields.push(customField);
|
||||
});
|
||||
|
||||
// Disable the form if in partial-edit mode
|
||||
// Must happen after the initial fields are populated
|
||||
|
||||
Reference in New Issue
Block a user