Class: IssuesFinder::Params

Inherits:
IssuableFinder::Params show all
Defined in:
app/finders/issues_finder/params.rb

Constant Summary

Constants inherited from IssuableFinder::Params

IssuableFinder::Params::FILTER_ANY, IssuableFinder::Params::FILTER_NONE, IssuableFinder::Params::NONE

Instance Attribute Summary

Attributes inherited from IssuableFinder::Params

#current_user, #klass

Instance Method Summary collapse

Methods inherited from IssuableFinder::Params

#assignee, #assignees, #author, #author_id?, #author_username?, #current_user_related?, #filter_by_any_assignee?, #filter_by_any_label?, #filter_by_any_milestone?, #filter_by_any_reaction?, #filter_by_any_release?, #filter_by_no_assignee?, #filter_by_no_label?, #filter_by_no_milestone?, #filter_by_no_reaction?, #filter_by_no_release?, #filter_by_started_milestone?, #filter_by_upcoming_milestone?, #find_group_projects, #group, #initialize, #label_names, #labels, #labels?, #merge, #merge!, #milestones, #milestones?, #no_author?, #present?, #project, #project?, #project_id, #projects, #related_groups, #releases?

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

This class inherits a constructor from IssuableFinder::Params

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IssuableFinder::Params

Instance Method Details

#filter_by_due_next_month_and_previous_two_weeks?Boolean

Returns:

  • (Boolean)

25
26
27
# File 'app/finders/issues_finder/params.rb', line 25

def filter_by_due_next_month_and_previous_two_weeks?
  due_date? && params[:due_date] == Issue::DueNextMonthAndPreviousTwoWeeks.name
end

#filter_by_due_this_month?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'app/finders/issues_finder/params.rb', line 21

def filter_by_due_this_month?
  due_date? && params[:due_date] == Issue::DueThisMonth.name
end

#filter_by_due_this_week?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'app/finders/issues_finder/params.rb', line 17

def filter_by_due_this_week?
  due_date? && params[:due_date] == Issue::DueThisWeek.name
end

#filter_by_no_due_date?Boolean

Returns:

  • (Boolean)

9
10
11
# File 'app/finders/issues_finder/params.rb', line 9

def filter_by_no_due_date?
  due_date? && params[:due_date] == Issue::NoDueDate.name
end

#filter_by_overdue?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'app/finders/issues_finder/params.rb', line 13

def filter_by_overdue?
  due_date? && params[:due_date] == Issue::Overdue.name
end

#public_only?Boolean

Returns:

  • (Boolean)

5
6
7
# File 'app/finders/issues_finder/params.rb', line 5

def public_only?
  params.fetch(:public_only, false)
end

#user_can_see_all_confidential_issues?Boolean

Returns:

  • (Boolean)

29
30
31
32
33
34
35
36
37
38
# File 'app/finders/issues_finder/params.rb', line 29

def user_can_see_all_confidential_issues?
  strong_memoize(:user_can_see_all_confidential_issues) do
    parent = project? ? project : group
    if parent
      Ability.allowed?(current_user, :read_confidential_issues, parent)
    else
      Ability.allowed?(current_user, :read_all_resources)
    end
  end
end

#user_cannot_see_confidential_issues?Boolean

Returns:

  • (Boolean)

40
41
42
43
44
# File 'app/finders/issues_finder/params.rb', line 40

def user_cannot_see_confidential_issues?
  return false if user_can_see_all_confidential_issues?

  current_user.blank?
end