class SpeechesController < 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]
end
def show
- @speech = Speech.show(params[:id], @author)
+ @speech = Speech.show(params[:id], [@user, @admin])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @speech.to_json(Speech.show_json_opt) }