The BuddyPress Group Roles plugin for WordPress and BuddyPress.