class PanelsController < ApplicationController
layout 'test' if MagicNumber['test_layout']
- before_filter :authenticate_user!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
+ if MagicNumber['run_mode'] == 0
+ before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ else
+ before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ end
before_filter :authenticate_admin!, :only => [:list, :browse]
public
respond_to do |format|
format.html # index.html.erb
format.json { render text: Panel.list_as_json_text(@panels) }
+ format.atom
+ format.rss { render :layout => false }
end
end
def show
- @panel = Panel.show(params[:id], @author)
+ @panel = Panel.show(params[:id], [@user, @admin])
respond_to do |format|
format.html # show.html.erb