The UI isn't really designed around right clicking type stuff, which would have been my first suggestion. So, maybe following the current shift-click logic, you can use ctrl-shift on the share button to share all or unshare all, similar to how ctrl-shift click currently cycles buildings on and off en-masse.