Set multiple fields as read-only if the session user is not the creator

Hi everyone,
I am trying to customize the leave request app and I want to ensure that backstops can only write on specific fields in the document. I have tried the following codes but not is toggling the field to read-only.

frappe.ui.form.on(“Leave Application”, {
onload: (frm) => {
if (
frm.doc.workflow_state === “Draft” &&
frm.doc.employee !== frappe.session.user_fullname
)
{
frm.set_df_property(“field_name”, “read_only”, 1);
}
}});

and

frappe.ui.form.on(“Leave Application”, {
validate: (frm) => {
if (
frm.doc.workflow_state === “Draft” &&
frm.doc.employee !== frappe.session.user_fullname
)
{cur_frm.set_df_property(“field_name”, “read_only”,1);}
}});

I’d appreciate some input, thanks.