app/controllers/bulkrax/entries_controller.rb in bulkrax-4.4.2 vs app/controllers/bulkrax/entries_controller.rb in bulkrax-5.0.0
- old
+ new
@@ -5,10 +5,11 @@
module Bulkrax
class EntriesController < ApplicationController
include Hyrax::ThemedLayoutController
before_action :authenticate_user!
+ before_action :check_permissions
with_themed_layout 'dashboard'
def show
if params[:importer_id].present?
show_importer
@@ -37,8 +38,12 @@
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
+
+ def check_permissions
+ raise CanCan::AccessDenied unless current_ability.can_import_works? || current_ability.can_export_works?
end
end
end