app/controllers/formol/topics_controller.rb in formol-0.0.4 vs app/controllers/formol/topics_controller.rb in formol-0.0.5
- old
+ new
@@ -70,9 +70,41 @@
topic.destroy
respond_with(topic, :location => forum)
end
+
+ def pin
+ formol_authorize!(current_formol_user, :pin_topic)
+
+ topic.pin_topic!
+
+ respond_with(topic, :location => [forum, topic])
+ end
+
+ def unpin
+ formol_authorize!(current_formol_user, :pin_topic)
+
+ topic.unpin_topic!
+
+ respond_with(topic, :location => [forum, topic])
+ end
+
+ def lock
+ formol_authorize!(current_formol_user, :lock_topic)
+
+ topic.lock_topic!
+
+ respond_with(topic, :location => [forum, topic])
+ end
+
+ def unlock
+ formol_authorize!(current_formol_user, :lock_topic)
+
+ topic.unlock_topic!
+
+ respond_with(topic, :location => [forum, topic])
+ end
protected
def topic
@topic ||= if params[:id].present?