OSDN Git Service

t#31056:add diff import
[pettanr/pettanr.git] / app / controllers / ground_colors_controller.rb
index d5883a6..da5244f 100644 (file)
@@ -1,7 +1,13 @@
 class GroundColorsController < ApplicationController
   layout 'test' if MagicNumber['test_layout']
-  before_filter :authenticate_user!, :only => [:index, :show]
-  before_filter :authenticate_author, :only => [:index, :show]
+  if MagicNumber['run_mode'] == 0
+    before_filter :authenticate_user, :only => []
+    before_filter :authenticate_author, :only => []
+  else
+    before_filter :authenticate_reader, :only => [:index, :show]
+    before_filter :authenticate_user, :only => []
+    before_filter :authenticate_author, :only => []
+  end
 
   # GET /ground_colors
   # GET /ground_colors.json
@@ -17,7 +23,7 @@ class GroundColorsController < ApplicationController
   end
   
   def show
-    @ground_color = GroundColor.show(params[:id], @author)
+    @ground_color = GroundColor.show(params[:id], [@user, @admin])
     respond_to do |format|
       format.html # show.html.erb
       format.json { render json: @ground_color.to_json(GroundColor.show_json_opt) }