Added getUserGroups function.