Module: CurationConcerns::EmbargoesControllerBehavior
- Extended by:
- ActiveSupport::Concern
- Includes:
- ManagesEmbargoes, Hydra::Collections::AcceptsBatches
- Included in:
- EmbargoesController
- Defined in:
- app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Removes a single embargo.
- #index ⇒ Object
-
#update ⇒ Object
Updates a batch of embargos.
Methods included from ManagesEmbargoes
Instance Method Details
#destroy ⇒ Object
Removes a single embargo
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb', line 16 def destroy EmbargoActor.new(curation_concern).destroy flash[:notice] = curation_concern..last if curation_concern.work? && curation_concern.file_sets.present? redirect_to (curation_concern) else redirect_to (curation_concern) end end |
#index ⇒ Object
11 12 13 |
# File 'app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb', line 11 def index :index, Hydra::AccessControls::Embargo end |
#update ⇒ Object
Updates a batch of embargos
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb', line 27 def update filter_docs_with_edit_access! copy_visibility = params[:embargoes].values.map { |h| h[:copy_visibility] } ActiveFedora::Base.find(batch).each do |curation_concern| EmbargoActor.new(curation_concern).destroy curation_concern.copy_visibility_to_files if copy_visibility.include?(curation_concern.id) end redirect_to end |