Sha256: 7162f7bb045e25db3d79e16c53667e37d8dd626f682b85a65cd5b8f0113fe48b

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true
module Hyrax
  class PermissionsController < ApplicationController
    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

    def curation_concern
      @curation_concern ||= Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: params[:id], use_valkyrie: false)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hyrax-3.0.2 app/controllers/hyrax/permissions_controller.rb
hyrax-3.0.1 app/controllers/hyrax/permissions_controller.rb
hyrax-3.0.0 app/controllers/hyrax/permissions_controller.rb
hyrax-3.0.0.pre.rc4 app/controllers/hyrax/permissions_controller.rb
hyrax-3.0.0.pre.rc3 app/controllers/hyrax/permissions_controller.rb