Where would an anonymous user plugin store its users?

(KajMagnus) #1


Where would you suggest that an anonymous users plugin store its users? (I.e. a plugin that allowed users to post comments without first logging in.) Would you suggest storing the anonymous users in the same database table as the authenticated users (i.e. the users table)? Or a separate table, which had only name and perhaps email and location columns? — If in a separate table, would you pick ids from the same id sequence as for authenticated users? (i.e. users_id_seq)

And why / not?

(This plugin seems like a good project if I want to learn Ruby + Discourse, but I’m not planning to write this plugin in the nearest future.)

(Not sure if this topic best belongs to the marketplace or dev category?)

Best regards,

(Sam Saffron) #2

Too many things will break without a user record. I would suggest. First working on a system that allows users to “opt-in” for an anonymous post. Meaning they are still logged in when posting but the post is not displayed in any of their public spots.

For true anonymous I would still create a dummy user record, just flag it with some custom data.

(Luke S) #3

How much/what info to store, and what gets put in the user record, is going to depend on what use-case your anonymous mode is trying to serve. Some possibilities:

  • I’m a normal user, but I want to have a discussion about something sensitive/contentious without tying it back to my public profile. (Probably served by @Sam’s suggestion, maybe limit to specific categories)
  • I’m just dropping by to ask a quick question. Why do I need to create an account to find out what size bolts fit my Acme Roof Rack Extender? (Again, probably limited to a single category or two)
  • I need to talk to someone, but I need to be sure that Forum Admin, Hackers, or anyone else who gets hold of the forum database can’t track back to me.

(KajMagnus) #4

@Sam thanks for your comment. I just found this thread:

It says “Anonymous posting mode” will be the focus of Discourse 1.3. I’m thinking then it might make little sense with a plugin for anonymous posts. Or perhaps the plans for Discourse 1.3 will allow only already registered users to post anonymously? (I.e. scenario 1 in @Sallsman63’s comment above)

(Jeff Atwood) #5

Definitely scenario 1. It is a current user posting in anonymous mode, always.