Sha256: e2120f7a2d8f88df4a551c2829bc9a0308835925e9a7c03cfe29c5da299615e6

Contents?: true

Size: 1.17 KB

Versions: 16

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true
module Hyrax
  class PermissionsController < ApplicationController
    load_resource class: Hyrax::Resource, instance_name: :curation_concern

    attr_reader :curation_concern
    helper_method :curation_concern

    def confirm
      # intentional noop to display default view
    end
    deprecation_deprecate confirm: "Use the #confirm_access action instead."

    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
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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