Where does writing what you know or the art of the telling detail become self-indulgence? Sometimes, it's obvious. The whisky drinker who slips in a reference to his favorite single malt, the car aficionado who lovingly reels off the model and year of the hero's vehicle, the movie fan who references a film or (worse!) describes a character by comparing him to an actor.
I've been convinced for a while that an author whose main character smokes is himself a smoker or former smoker. For instance, I've just started reading Eleven Days by Donald Harstad, who is a former cop, and his first-person hero, a cop, describes himself as a "heavy smoker." This may be an important element of characterization or even plot, but it seems at first blush to be a self-indulgent expression of defiance ("you gotta problem with that, this is the way cops are").
Sometimes an author seems to be indulging in a personal fantasy. In The Essene Conspiracy, S. Eric Wachtel is a bit too meticulous chronicling his hero's high-living lifestyle, reflecting either, one is tempted to think, his own fantasy or even his own fantasy-come-true. In The Sound of Blood, Lawrence DeMaria endows the female antagonist, Alana Loeb, with almost superhuman qualities of sexiness and cleverness, stretching the reader's suspension of disbelief.
It is not a coincidence, I think, that it's easier to find examples of self-indulgence in self-published books. Part of an editor's job is to ruthlessly cut and trim the author's self-indulgent flights of fancy. This was my experience with Gold, where Dick Marek callously cut out some of my slips, and in The Grand Mirage, where Jerry Gross marked whole passages for elimination (it was always my choice, but I generally followed his recommendations).
When it's not possible to get that kind of editing -- and that may be as true today for mainstream publishing as well as self-publishing -- it is up to the writer to exercise some self-discipline and rigorously ask himself whether certain details are necessary to plot or characterization. The line is not always clear, but the writer who crosses that line is detracting from his own effort to immerse the reader in this fictional world with these often jarring and irrelevant references.