It's strange, with rules.forbid_tool() you can hide toolbar buttons.
But with rules.allow_tool() you can't show them.
It works with normal tools.
https://dwachs.github.io/simutrans-sqapi-doc/classrules.html (https://dwachs.github.io/simutrans-sqapi-doc/classrules.html)
It's possible that this is because no tools are allowed for the menu. Empty menus are hidden.
The tutorial is quite confusing on this point.
sorry, function works correct