For the purpose of restricting certain fields in a data model from being edited by any user, I should be able to target the current user's role in a validation hook.
Something like
async function run() {
if (context.user.role != 'admin') {
return {
level: 'error',
message: 'only users with admin access can edit this field'
}
}
}
return run();
Assuming this user role context was added, this could also be accomplished with an "isDisabled" option for inputs, which could let you return a truthy/falsey statement.
Disabled state for inputs could be used for other purposes too, like read-only values that have inputs dynamically set elsewhere.