Added function to get user groups.