Well according to
https://wowwiki.fandom.com/wiki/Secu...ButtonTemplate it is possible. I realise I hadn't commented out my old onclick function, (which is how I discovered disenchant was protected) but the execution of the button isn't my issue. I just can't see the button when using the secure template.