How to hide some of these checkboxs from USER doctype, ROLE PERMISSIONS tab?

I would like to hide some of these checkboxes from the role & permissions tab of the user page without dissablling them in the role list. can you guide please

There are multiple ways to achieve this:

  1. You can write a client script for the User doctype like this:
frappe.ui.form.on('User', {
	refresh(frm) {
		// your code here
        $('div.checkbox.unit-checkbox label input[data-unit="Academics User"]').closest('div.checkbox.unit-checkbox').hide();
	}
})
  1. You can override the whitelist method and filter roles based on your requirements.
3 Likes

the script works fine, but when I click on a link that goes to another page and i return so the “Academics User” shows again. how can we prevent that

thank you

@Rebaz_Balisani i think if you call the function on onload or setup it might solve this issue