Commit 5b7fd663 authored by Brett Walker's avatar Brett Walker Committed by Heinrich Lee Yu

Don't allow anonymous users to search with text

If you're an anonymous user and the
`: disable_anonymous_search` flag is turned on,
then we don't allow them to
perform a text search in Issues, Epics, or Merge Requests.

Changelog: changed
parent f9d17877
......@@ -332,6 +332,7 @@ class IssuableFinder
def by_search(items)
return items unless search
return items if items.is_a?(ActiveRecord::NullRelation)
return items if Feature.enabled?(:disable_anonymous_search, type: :ops) && current_user.nil?
if use_cte_for_search?
cte = Gitlab::SQL::CTE.new(klass.table_name, items)
......
---
name: disable_anonymous_search
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70223
rollout_issue_url:
milestone: '14.3'
type: ops
group: group::project management
default_enabled: false
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment