Module: Hyrax::LeasesControllerBehavior
- Extended by:
- ActiveSupport::Concern
- Includes:
- Collections::AcceptsBatches, ManagesEmbargoes
- Included in:
- LeasesController
- Defined in:
- app/controllers/concerns/hyrax/leases_controller_behavior.rb
Class Method Summary collapse
-
.local_prefixes ⇒ Object
This allows us to use the unauthorized template in curation_concerns/base.
Instance Method Summary collapse
-
#destroy ⇒ Object
Removes a single lease.
- #edit ⇒ Object
- #index ⇒ Object
- #update ⇒ Object
Methods included from Collections::AcceptsBatches
#batch, #batch=, #check_for_empty_batch?
Methods included from ManagesEmbargoes
Class Method Details
.local_prefixes ⇒ Object
This allows us to use the unauthorized template in curation_concerns/base
40 41 42 |
# File 'app/controllers/concerns/hyrax/leases_controller_behavior.rb', line 40 def self.local_prefixes ['hyrax/base'] end |
Instance Method Details
#destroy ⇒ Object
Removes a single lease
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/concerns/hyrax/leases_controller_behavior.rb', line 16 def destroy Hyrax::Actors::LeaseActor.new(curation_concern).destroy flash[:notice] = curation_concern.lease_history.last if curation_concern.work? && curation_concern.file_sets.present? redirect_to else redirect_to edit_lease_path end end |
#edit ⇒ Object
44 45 46 47 48 49 |
# File 'app/controllers/concerns/hyrax/leases_controller_behavior.rb', line 44 def edit t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.leases.index.manage_leases'), hyrax.leases_path t(:'hyrax.leases.edit.lease_update'), '#' end |
#index ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/concerns/hyrax/leases_controller_behavior.rb', line 8 def index t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.leases.index.manage_leases'), hyrax.leases_path :index, Hydra::AccessControls::Lease end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/concerns/hyrax/leases_controller_behavior.rb', line 26 def update filter_docs_with_edit_access! copy_visibility = [] copy_visibility = params[:leases].values.map { |h| h[:copy_visibility] } if params[:leases] af_objects = Hyrax.custom_queries.find_many_by_alternate_ids(alternate_ids: batch, use_valkyrie: false) af_objects.each do |curation_concern| Hyrax::Actors::LeaseActor.new(curation_concern).destroy Hyrax::VisibilityPropagator.for(source: curation_concern).propagate if copy_visibility.include?(curation_concern.id) end redirect_to leases_path end |