I haven't found a way so far.
It seems so obviously necessary.
I used to use Advanced Profile Control to do this, however that developer has simply vanished (mikkosoft.fi). Unfortunate because he was doing some good stuff.
There's another plugin out there that does this:
www.joomlashake.com/
It's commercial and requires Ioncube.
I haven't used it yet but am probably about to try it.