Class: BaseProjectService

Inherits:
BaseContainerService show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/base_project_service.rb

Overview

Base class, scoped by project

Instance Attribute Summary collapse

Attributes inherited from BaseContainerService

#container, #current_user, #group, #params

Instance Method Summary collapse

Methods inherited from BaseContainerService

#group_container?, #namespace_container?, #project_container?

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(project:, current_user: nil, params: {}) ⇒ BaseProjectService

Returns a new instance of BaseProjectService.



9
10
11
12
13
14
15
# File 'app/services/base_project_service.rb', line 9

def initialize(project:, current_user: nil, params: {})
  # we need to exclude project params since they may come from external requests. project should always
  # be passed as part of the service's initializer
  super(container: project, current_user: current_user, params: params.except(:project, :project_id))

  @project = project
end

Instance Attribute Details

#projectObject

Returns the value of attribute project.



7
8
9
# File 'app/services/base_project_service.rb', line 7

def project
  @project
end