Sha256: a6176205a6c079a8dce6c2ec151992e28aa847041a50a175e7c3c11149c6c53e

Contents?: true

Size: 810 Bytes

Versions: 16

Compression:

Stored size: 810 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module ManagesEmbargoes
    extend ActiveSupport::Concern

    included do
      attr_accessor :curation_concern
      helper_method :curation_concern
      base_class = Hyrax.config.use_valkyrie? ? Hyrax::Resource : ActiveFedora::Base
      load_and_authorize_resource class: base_class, instance_name: :curation_concern, except: [:index]
    end

    # This is an override of Hyrax::ApplicationController
    def deny_access(exception)
      redirect_to root_path, alert: exception.message
    end

    def edit; end

    private

    def work_has_file_set_members?(work)
      case work
      when Valkyrie::Resource
        Hyrax.custom_queries.find_child_file_set_ids(resource: work).any?
      else
        work.file_sets.present?
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.4 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.3 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.2 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.1 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.0 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.0.rc3 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.0.rc2 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-5.0.0.rc1 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-3.6.0 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-4.0.0 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-4.0.0.rc3 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-4.0.0.rc2 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-4.0.0.rc1 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-3.5.0 app/controllers/concerns/hyrax/manages_embargoes.rb
hyrax-4.0.0.beta2 app/controllers/concerns/hyrax/manages_embargoes.rb