radar/forem — Issue #122: Anybody can subscribe to any topic
Author: radar
Created: 2012-01-08 21:22:00+00:00
State: open

Currently in the TopicsController there's this code for the `subscribe` action:

def subscribe
@topic = Topic.find(params[:id])
authorize! :read, @topic
@topic.subscribe_user(forem_user.id)
flash[:notice] = t("forem.topic.subscribed")
redirect_to forum_topic_url(@topic.forum, @topic)
end

This doesn't check to see if the topic is hidden, but should. It should also check to see if the user has access to that forum at all also.