Added utility function to check if user is part of some groups.