mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SECURITY: only show restricted tag lists to authorized users (#20004)
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
This commit is contained in:
@@ -5,12 +5,13 @@ class TagsController < ::ApplicationController
|
||||
include TopicQueryParams
|
||||
|
||||
before_action :ensure_tags_enabled
|
||||
before_action :ensure_visible, only: %i[show info]
|
||||
|
||||
def self.show_methods
|
||||
Discourse.anonymous_filters.map { |f| :"show_#{f}" }
|
||||
end
|
||||
|
||||
before_action :ensure_visible, only: [:show, :info, *show_methods]
|
||||
|
||||
requires_login except: [:index, :show, :tag_feed, :search, :info, *show_methods]
|
||||
|
||||
skip_before_action :check_xhr, only: [:tag_feed, :show, :index, *show_methods]
|
||||
|
||||
Reference in New Issue
Block a user