OSDN Git Service

t#31056:add diff import
[pettanr/pettanr.git] / app / controllers / balloons_controller.rb
index 745e449..d3c6727 100644 (file)
@@ -1,11 +1,12 @@
 class BalloonsController < ApplicationController
   layout 'test' if MagicNumber['test_layout']
   if MagicNumber['run_mode'] == 0
-    before_filter :authenticate_user!, :only => []
+    before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   else
-    before_filter :authenticate_user!, :only => [:index, :show]
-    before_filter :authenticate_author, :only => [:index, :show]
+    before_filter :authenticate_reader, :only => [:index, :show]
+    before_filter :authenticate_user, :only => []
+    before_filter :authenticate_author, :only => []
   end
   before_filter :authenticate_admin!, :only => [:list, :browse]
   
@@ -21,7 +22,7 @@ class BalloonsController < ApplicationController
   end
   
   def show
-    @balloon = Balloon.show(params[:id], @author)
+    @balloon = Balloon.show(params[:id], [@user, @admin])
     respond_to do |format|
       format.html # show.html.erb
       format.json { render json: @balloon.to_json(Balloon.show_json_opt) }