def _RowToGRRUser(self, row):
    """Creates a GRR user object from a database result row."""
    username, password, ui_mode, canary_mode, user_type = row
    result = rdf_objects.GRRUser(
        username=username,
        ui_mode=ui_mode,
        canary_mode=canary_mode,
        user_type=user_type)

    if password:
      result.password.ParseFromString(password)

    return result