Extracted shared code to find group membership for current user