Skip to content

A platform for community discussion. Free, open, simple.

FIX: tag groups page should only be visible to staff

Neil Lalonde6f1b8ad16dab
diff --git a/app/controllers/tag_groups_controller.rb b/app/controllers/tag_groups_controller.rb
index 4fd4f0f6e0a..d0ee16587c4 100644
--- a/app/controllers/tag_groups_controller.rb
+++ b/app/controllers/tag_groups_controller.rb
@@ -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]
diff --git a/config/routes.rb b/config/routes.rb
index c661b0a7271..0b1e92a36aa 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -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