Class: FeatureFlagsUserListsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/feature_flags_user_lists_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, current_user, params = {}) ⇒ FeatureFlagsUserListsFinder

Returns a new instance of FeatureFlagsUserListsFinder.



6
7
8
9
10
# File 'app/finders/feature_flags_user_lists_finder.rb', line 6

def initialize(project, current_user, params = {})
  @project = project
  @current_user = current_user
  @params = params
end

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.



4
5
6
# File 'app/finders/feature_flags_user_lists_finder.rb', line 4

def current_user
  @current_user
end

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'app/finders/feature_flags_user_lists_finder.rb', line 4

def params
  @params
end

#projectObject (readonly)

Returns the value of attribute project.



4
5
6
# File 'app/finders/feature_flags_user_lists_finder.rb', line 4

def project
  @project
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
# File 'app/finders/feature_flags_user_lists_finder.rb', line 12

def execute
  unless Ability.allowed?(current_user, :read_feature_flag, project)
    return Operations::FeatureFlagsUserList.none
  end

  items = feature_flags_user_lists
  by_search(items)
end