diff --git a/app/models/user.rb b/app/models/user.rb index ed7165aa..d38d9efc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -36,6 +36,10 @@ def to_s email end + def is_admin + has_role? :admin + end + def is_superadmin has_role? :superadmin end diff --git a/config/routes.rb b/config/routes.rb index f08a9431..757c8620 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,12 +6,12 @@ concern :iiif_search, BlacklightIiifSearch::Routes.new concern :oai_provider, BlacklightOaiProvider::Routes.new - + mount Hyrax::IiifAv::Engine, at: '/' mount Riiif::Engine => 'images', as: :riiif if Hyrax.config.iiif_image_server? - authenticate :user, lambda { |u| u.is_superadmin } do - mount Sidekiq::Web => '/sidekiq' + authenticate :user, lambda { |u| u.is_superadmin || u.is_admin } do + mount Sidekiq::Web => '/jobs' end if ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYKU_MULTITENANT', false))