Add this Binding to the button (or whatever you want to hide when the Diagram.isReadOnly):
new go.Binding("visible", "", function(o) { return !o.diagram.isReadOnly; }).ofObject()
If you are changing the Diagram.isReadOnly state dynamically, you may need to call Diagram.updateAllTargetBindings(), although for efficiency you do not want to call this often!