Please try it.
frappe.ui.form.on('Your DocType', {
refresh: function(frm) {
if (!frappe.user.has_role('System Manager')) {
$('.assignments').hide();
} else {
$('.assignments').show();
}
}
});
Please set your doctype name and script according to the scenario.