class GroundColorsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
- before_filter :authenticate_user!, :only => [:index]
+ layout 'test' if MagicNumber['test_layout']
+ 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
format.json { render :json => @ground_colors.to_json(GroundColor.list_json_opt) }
end
end
+
+ def show
+ @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) }
+ end
+ end
end