Class: Clusters::Agents::Authorizations::CiAccess::FilterService

Inherits:
Object
  • Object
show all
Defined in:
app/services/clusters/agents/authorizations/ci_access/filter_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(authorizations, filter_params, project) ⇒ FilterService

Returns a new instance of FilterService.



8
9
10
11
12
13
14
# File 'app/services/clusters/agents/authorizations/ci_access/filter_service.rb', line 8

def initialize(authorizations, filter_params, project)
  @authorizations = authorizations
  @filter_params = filter_params
  @project = project

  @environments_matcher = {}
end

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
# File 'app/services/clusters/agents/authorizations/ci_access/filter_service.rb', line 16

def execute
  filtered_authorizations = filter_by_environment(authorizations)
  if Feature.enabled?(:kubernetes_agent_protected_branches, project)
    filtered_authorizations = filter_protected_ref(filtered_authorizations)
  end

  filtered_authorizations
end