- layout 'test' if MagicNumber['test_layout']
- before_filter :authenticate_user!, :only => [:index, :show, :edit, :update]
- before_filter :authenticate_admin!, :only => [:list, :browse]
-
- def index
- @page = Author.page params[:page]
- @page_size = Author.page_size params[:page_size]
- @authors = Author.list(@page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render :json => @authors.to_json(Author.list_json_opt) }
- end
+ if Manifest.manifest.magic_numbers['run_mode'] == 0
+ before_action :authenticate_user, :only => [:new, :create, :edit, :update]
+ before_action :authenticate_author, :only => [:edit, :update]
+ else
+ before_action :authenticate_reader, :only => [:index, :show]
+ before_action :authenticate_user, :only => [:new, :create, :edit, :update]
+ before_action :authenticate_author, :only => [:edit, :update]