Class: Hyrax::PermissionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/hyrax/permissions_controller.rb

Instance Method Summary collapse

Instance Method Details

#confirmObject


5
6
7
# File 'app/controllers/hyrax/permissions_controller.rb', line 5

def confirm
  # intentional noop to display default view
end

#confirm_accessObject


16
17
18
# File 'app/controllers/hyrax/permissions_controller.rb', line 16

def confirm_access
  # intentional noop to display default view
end

#copyObject


9
10
11
12
13
14
# File 'app/controllers/hyrax/permissions_controller.rb', line 9

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

#copy_accessObject


20
21
22
23
24
25
26
27
28
# File 'app/controllers/hyrax/permissions_controller.rb', line 20

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

#curation_concernObject


30
31
32
# File 'app/controllers/hyrax/permissions_controller.rb', line 30

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