First off, I do write the occasional Harry Potter fan fiction story and the more frequent Pern one, so I can't exactly oppose it without being a hypocrite.
If I were a professionally-published author, it would disturb me greatly if fans wrote stories featuring my characters without my permission. There are some genres of fan fiction that I would be very offended to find my characters being used in.
I prefer Anne McCaffrey's approach: Use of my settings would be fine, but use of any of my characters would not at all be permitted. Only certain very close friends of mine, who have known me for years, would have permission to write my characters...That would be Viv, Anna, Hope, Dave, Suse, and Tricia. And there are only specific characters whom each of those friends would be appropriate for.
Except for Dave...I don't think Dave has ever read anything about my character Paul Graves, but I suspect he'd figure him out very quickly and would probably write him way better than I do. :)