$user = JFactory::getUser();
$user_id = xx;
if( in_array($user_id, $user->groups ) ){
   return true;
} else {
   return false;
}