FIX: tag groups page should only be visible to staff

No security concern here because nothing private was visible,
and no actions could be taken by non-staff users.
This commit is contained in:
Neil Lalonde 2018-09-17 11:40:15 -04:00
parent fb9e3e6423
commit 6f1b8ad16d
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
class TagGroupsController < ApplicationController
requires_login except: [:index, :show]
requires_login
before_action :ensure_staff
skip_before_action :check_xhr, only: [:index, :show]
before_action :fetch_tag_group, only: [:show, :update, :destroy]

View File

@ -793,7 +793,7 @@ Discourse::Application.routes.draw do
end
end
resources :tag_groups, except: [:new, :edit] do
resources :tag_groups, constraints: StaffConstraint.new, except: [:new, :edit] do
collection do
get '/filter/search' => 'tag_groups#search'
end