1 class AuthorsController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_action :authenticate_user, :only => [:new, :create, :edit, :update]
4 before_action :authenticate_author, :only => [:edit, :update]
6 before_action :authenticate_reader, :only => [:index, :show]
7 before_action :authenticate_user, :only => [:new, :create, :edit, :update]
8 before_action :authenticate_author, :only => [:edit, :update]
15 def show_html_format format
22 respond_to do |format|
23 show_html_format format
24 show_prof_format format
25 show_json_format format
39 @item = @my_model_class.new
41 @item.attributes = @item.permit_params params
42 @item.overwrite @operators
43 render_create root_path
48 @item.attributes = @item.permit_params params
49 @item.overwrite @operators
50 render_update '/home/configure'
55 @item = @my_model_class.edit(params[:id], @operators)
56 render_destroy '/home/configure'