Class: WorkItems::NamespaceWorkItemsFinder

Inherits:
WorkItemsFinder show all
Defined in:
app/finders/work_items/namespace_work_items_finder.rb

Constant Summary collapse

FilterNotAvailableError =
Class.new(ArgumentError)

Constants inherited from IssuesFinder

IssuesFinder::CONFIDENTIAL_ACCESS_LEVEL

Constants inherited from IssuableFinder

IssuableFinder::FULL_TEXT_SEARCH_TERM_PATTERN, IssuableFinder::FULL_TEXT_SEARCH_TERM_REGEX, IssuableFinder::NEGATABLE_PARAMS_HELPER_KEYS

Instance Attribute Summary

Attributes inherited from IssuableFinder

#current_user, #original_params, #params

Attributes included from FinderWithCrossProjectAccess

#should_skip_cross_project_check

Instance Method Summary collapse

Methods inherited from WorkItemsFinder

#params_class

Methods inherited from IssuesFinder

#klass, #params_class, scalar_params

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods inherited from IssuableFinder

array_params, #count_by_state, #execute, #filter_negated_items, #klass, negatable_array_params, negatable_params, negatable_scalar_params, #params_class, #parent_param, #parent_param=, #row_count, scalar_params, #search, #should_filter_negated_args?, #use_cte_for_search?, valid_params

Methods included from UpdatedAtFilter

#by_updated_at

Methods included from CreatedAtFilter

#by_created_at

Methods included from FinderMethods

#find, #find_by, #find_by!

Methods included from FinderWithCrossProjectAccess

#can_read_cross_project?, #can_read_project?, #execute, #find, #find_by, #find_by!, #skip_cross_project_check

Constructor Details

#initializeNamespaceWorkItemsFinder

Returns a new instance of NamespaceWorkItemsFinder.



7
8
9
10
11
# File 'app/finders/work_items/namespace_work_items_finder.rb', line 7

def initialize(...)
  super

  self.parent_param = namespace
end

Instance Method Details

#with_confidentiality_access_checkObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/finders/work_items/namespace_work_items_finder.rb', line 14

def with_confidentiality_access_check
  return model_class.all if params.user_can_see_all_issuables?

  # Only admins can see hidden issues, so for non-admins, we filter out any hidden issues
  issues = model_class.without_hidden

  return issues.all if params.user_can_see_all_confidential_issues?

  return issues.public_only if params.user_cannot_see_confidential_issues?

  issues.with_confidentiality_check(current_user)
end