app/controllers/works_controller.rb
# only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works
def collected
    if params[:work_search].present?
      options = params[:work_search].dup
    else
      options = {}
    end
    options.merge!(page: params[:page])
    options[:show_restricted] = current_user.present? || logged_in_as_admin?
    @user = User.find_by_login(params[:user_id])
    return unless @user.present?
    if @admin_settings.disable_filtering?
      @works = Work.collected_without_filters(@user, options)
    else
      @search = WorkSearch.new(options.merge(works_parent: @user, collected: true))
      @works = @search.search_results
      @facets = @works.facets
    end
    @page_subtitle = ts("%{username} - Collected Works", username: @user.login)
  end
def collected if params [ :work_search ] . present? options = params [ :work_search ] . dup else options = { } end options . merge! ( page : params [ :page ] ) options [ :show_restricted ] = current_user . present? || logged_in_as_admin? @user = User . find_by_login ( params [ :user_id ] ) return unless @user . present? if @admin_settings . disable_filtering? @works = Work . collected_without_filters ( @user , options ) else @search = WorkSearch . new ( options . merge ( works_parent : @user , collected : true ) ) @works = @search . search_results @facets = @works . facets end @page_subtitle = ts ( "%{username} - Collected Works" , username : @user . login ) end
only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works