Hi all,
this is a hack that might be useful to some of you: consider you have a core doctype like the project, which can be renamed. Now, you would like to prevent renaming this (e.g. see Disable Rename Item). Unfortunately, allow_rename cannot be customised; so either you fork the core, which is certainly not a good option. Or, you add a custom script with something like
/* remove rename handler from title */
var elements = document.getElementsByClassName("title-text");
var old_element = elements[0];
var new_element = old_element.cloneNode(true);
old_element.parentNode.replaceChild(new_element, old_element);
/* remove the remove option from the menu */
$("span[data-label='Rename']").parent().parent().remove();
Hopefully this is helpful to someone else (other than me )