I want to write a helper block to check if a section should be displayed for a specific role:
{{#allowApprover "EMP"}}
{{/allowApprover}}
And the assistant is defined as:
allowApprover: (currentRole, options) => {
return permit(currentRole) ? options.fn(this) : options.inverse(this)
}
The code above does not work, I think, because it thisbehaves differently in arrows, but I donβt know how to do it, and another question: what does options.fnit exactly?
source
share