docs: def user_add_to_group_action(model, request):
      """Add user to group.
      """
      group_id = request.params.get('id')
      if not group_id:
          group_ids = request.params.getall('id[]')
      else:
          group_ids = [group_id]
      try:
          user = model.model
          validate_add_users_to_groups(model, [user.id], group_ids)
          groups = user.root.groups
          for group_id in group_ids:
              groups[group_id].add(user.name)
          groups()
          model.parent.invalidate(user.name)
          localizer = get_localizer(request)
          message = localizer.translate(_(
              'added_user_to_group',
              default="Added user '${uid}' to group '${gid}'.",
              mapping={
                  'uid': user.id,
                  'gid': ', '.join(group_ids)
              }
          ))
          return {
              'success': True,
              'message': message
          }
      except ManageMembershipError as e:
          if e.reason is not LM_TARGET_GID_NOT_ALLOWED:
              raise Exception(u"Unknown ManageMembershipError reason.")
          localizer = get_localizer(request)
          message = localizer.translate(_(
              'lm_add_target_gid_not_allowed',
              default=(
                  "Failed adding user '${uid}' to group '${gid}'. "
                  "Manage membership denied for target group."
              ),
              mapping={
                  'uid': user.id,
                  'gid': e.data
              }
          ))
          return {
              'success': False,
              'message': message
          }
      except Exception as e:
          return {
              'success': False,
              'message': str(e)
          }