Sha256: f2480dc79afd3342a61f859111f22e5afbd269c2f32c55efdaa8520aaf102c18

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

module Hyrax
  module PermissionsControllerBehavior
    extend ActiveSupport::Concern

    included do
      helper_method :curation_concern
    end

    def confirm
      # intentional noop to display default view
    end

    def copy
      authorize! :edit, curation_concern
      VisibilityCopyJob.perform_later(curation_concern)
      flash_message = 'Updating file permissions. This may take a few minutes. You may want to refresh your browser or return to this record later to see the updated file permissions.'
      redirect_to [main_app, curation_concern], notice: flash_message
    end

    def confirm_access
      # intentional noop to display default view
    end

    def copy_access
      authorize! :edit, curation_concern
      # copy visibility
      VisibilityCopyJob.perform_later(curation_concern)

      # copy permissions
      InheritPermissionsJob.perform_later(curation_concern)
      redirect_to [main_app, curation_concern], notice: I18n.t("hyrax.upload.change_access_flash_message")
    end

    def curation_concern
      @curation_concern ||= ActiveFedora::Base.find(params[:id])
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.1.0 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.5 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.4 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.3 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.2 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.1 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.0.rc2 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
hyrax-1.0.0.rc1 app/controllers/concerns/hyrax/permissions_controller_behavior.rb
test_hyrax-0.0.1.alpha app/controllers/concerns/hyrax/permissions_controller_behavior.rb