Feature request: Anonymous user can create topic #271

Closed
kunalchaudhari opened this Issue Jul 30, 2012 · 10 comments

Comments

Projects
None yet
3 participants
Contributor

kunalchaudhari commented Jul 30, 2012

It will be great to have this. Anonymous user can create topic for forum. we can have preference flag set for forum like allow_anonymous. If that is set Anonymous user can create topic in that forum.

Contributor

parndt commented Jul 30, 2012

Can you elaborate further on why you would want anonymous users creating topics? Thanks!

Contributor

kunalchaudhari commented Jul 30, 2012

This can be thought as a open forum where anyone can post without sign up. So user dont need to register to create topic/post. How is this sounds?

Contributor

kunalchaudhari commented Jul 30, 2012

Recently i came across one such requirement. So i think people use this kind of open forum thing

Contributor

parndt commented Jul 30, 2012

I'm curious:

  • How would you link posts / topics to particular people?
  • How would you know who is posting?
  • Is this a functionality that you would actually implement and use?
Contributor

kunalchaudhari commented Jul 30, 2012

  • In our app we can create an anonymous user on the fly whenever anonymous user create post/topic. user will be created with generated token (token@example.com).
  • posts/topics can be displayed as posted by anonymous user. all user fields will be generated by app as mentioned above.
  • yeah i have such requirement from client. you can see it here also http://4chan.org
Contributor

parndt commented Jul 30, 2012

@radar @knewter would love your opinions

Contributor

kunalchaudhari commented Jul 30, 2012

at this moment i have done it in bit ugly way. i have modified the forem_user method like this. So if user is not logged in than anonymous user can created and signed in. So this user will be linked to post/topic while creating. For this to work new and create action of topics_controller are removed from authentication check (that is from before_filter). This is still in work but looks ugly.

  def forem_user
    user = current_user
    user ||= User.anonymous!
    unless user_signed_in?
      sign_in(user)
    end
    user
  end

User.anonymous! create a user by generating token. Taken from Spree::User.rb(auth/app/models/user.rb)

Contributor

kunalchaudhari commented Jul 30, 2012

here is my implementation in app. https://gist.github.com/3205867

Collaborator

radar commented Jul 31, 2012

I like the idea behind this, but am afraid of technical debt that this would bring on.

Contributor

kunalchaudhari commented Jul 31, 2012

@radar yeah i agree. I am having hard time doing this for my client but i have to done it some way :). But i think this kind open forum has place as people try to discuss on some open topics. I am not expert rails but would ready to work on it though with mentoring.

parndt closed this Jun 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment