Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant to see sidekiq #135

Merged
merged 3 commits into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def to_s
email
end

def is_admin
has_role?(:admin) || has_role?(:admin, Site.instance)
end

def is_superadmin
has_role? :superadmin
end
Expand Down
6 changes: 3 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏾

end

if ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYKU_MULTITENANT', false))
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ services:

web:
<<: *app
# Uncomment command to access container with out starting Rails. Useful for debugging
# command: sleep infinity
# command: sh -l -c "bundle && bundle exec rails s -b 0.0.0.0"
environment:
- VIRTUAL_PORT=3000
- VIRTUAL_HOST=.hyku.test
Expand Down
Loading