Sha256: 4e592809d087e824031cabcff32caf0c54d9fd1b4f5aba64807867473fded511

Contents?: true

Size: 564 Bytes

Versions: 4

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module SingularSubresourceController
    extend ActiveSupport::Concern
    include DenyAccessOverrideBehavior

    included do
      before_action :find_work, only: :work
      before_action :find_file_set, only: :file
      load_and_authorize_resource :work, only: :work
      load_and_authorize_resource :file, only: :file
    end

    def find_work
      @work = Hyrax.query_service.find_by(id: params[:id])
    end

    def find_file_set
      @file = Hyrax.query_service.find_by(id: params[:id])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/controllers/concerns/hyrax/singular_subresource_controller.rb
hyrax-5.0.4 app/controllers/concerns/hyrax/singular_subresource_controller.rb
hyrax-5.0.3 app/controllers/concerns/hyrax/singular_subresource_controller.rb
hyrax-5.0.2 app/controllers/concerns/hyrax/singular_subresource_controller.rb