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:
- 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();
}
})
- 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