moderation routes require moderation status
This commit is contained in:
parent
96a298b8c2
commit
755bbac2d7
|
@ -1,14 +1,21 @@
|
|||
require 'sidekiq/web'
|
||||
Rails.application.routes.draw do
|
||||
|
||||
get 'moderation/index'
|
||||
|
||||
# Admin panel
|
||||
mount RailsAdmin::Engine => '/justask_admin', as: 'rails_admin'
|
||||
|
||||
# Sidekiq
|
||||
constraints ->(req) { req.env["warden"].authenticate?(scope: :user) &&
|
||||
req.env['warden'].user.admin? } do
|
||||
mount Sidekiq::Web, at: "/sidekiq"
|
||||
end
|
||||
|
||||
# Moderation panel
|
||||
constraints ->(req) { req.env['warden'].authenticate?(scope: :user) &&
|
||||
(req.env['warden'].user.admin? or req.env['warden'].user.moderator?) } do
|
||||
match '/moderation', to: 'moderation#index', via: :get, as: :moderation
|
||||
end
|
||||
|
||||
root 'static#index'
|
||||
|
||||
match '/about', to: 'static#about', via: 'get'
|
||||
|
|
Loading…
Reference in New Issue