My mistake. That should be "or", not "and". I've corrected my post above.
By the way, is your version 6.3.2? When dealing with this level of detail, you should always specify what version you're using.
Also, you didn't specify whether you want moderators and adminstrators to have access regardless of whether they're in group #10. If so, you'd have to add more stuff to the if-condition.