Class: Bulkrax::EntriesController

Inherits:
ApplicationController show all
Includes:
Hyrax::ThemedLayoutController
Defined in:
app/controllers/bulkrax/entries_controller.rb

Instance Method Summary collapse

Instance Method Details

#check_permissionsObject

Raises:

  • (CanCan::AccessDenied)


47
48
49
# File 'app/controllers/bulkrax/entries_controller.rb', line 47

def check_permissions
  raise CanCan::AccessDenied unless current_ability.can_import_works? || current_ability.can_export_works?
end

#showObject



13
14
15
16
17
18
19
# File 'app/controllers/bulkrax/entries_controller.rb', line 13

def show
  if params[:importer_id].present?
    show_importer
  elsif params[:exporter_id].present?
    show_exporter
  end
end

#show_exporterObject

GET /exporters/1/entries/1



35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/bulkrax/entries_controller.rb', line 35

def show_exporter
  @exporter = Exporter.find(params[:exporter_id])
  @entry = Entry.find(params[:id])

  return unless defined?(::Hyrax)
  add_breadcrumb t(:'hyrax.controls.home'), main_app.root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb 'Exporters', bulkrax.exporters_path
  add_breadcrumb @exporter.name, bulkrax.exporter_path(@exporter.id)
  add_breadcrumb @entry.id
end

#show_importerObject

GET /importers/1/entries/1



22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/bulkrax/entries_controller.rb', line 22

def show_importer
  @importer = Importer.find(params[:importer_id])
  @entry = Entry.find(params[:id])

  return unless defined?(::Hyrax)
  add_breadcrumb t(:'hyrax.controls.home'), main_app.root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb 'Importers', bulkrax.importers_path
  add_breadcrumb @importer.name, bulkrax.importer_path(@importer.id)
  add_breadcrumb @entry.id
end