mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:09:53 +01:00
Update admin/announcements routes to use has_role?
This commit is contained in:
parent
391f4a28ed
commit
e731d76d52
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,7 @@ Rails.application.routes.draw do
|
|||
match '/:username/questions(/p/:page)', to: 'user#questions', via: 'get', as: :show_user_questions, defaults: {page: 1}
|
||||
|
||||
constraints ->(req) { req.env['warden'].authenticate?(scope: :user) &&
|
||||
(req.env['warden'].user.admin?) } do
|
||||
(req.env['warden'].user.has_role?(:administrator)) } do
|
||||
match "/admin/announcements", to: "announcement#index", via: :get, as: :announcement_index
|
||||
match "/admin/announcements", to: "announcement#create", via: :post, as: :announcement_create
|
||||
match "/admin/announcements/new", to: "announcement#new", via: :get, as: :announcement_new
|
||||
|
|
Loading…
Reference in a new issue