Class: Members::ImportProjectTeamService

Inherits:
BaseService show all
Defined in:
app/services/members/import_project_team_service.rb

Constant Summary collapse

ImportProjectTeamForbiddenError =
Class.new(StandardError)

Instance Attribute Summary

Attributes inherited from BaseService

#project

Instance Method Summary collapse

Methods inherited from BaseService

#after_execute

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(*args) ⇒ ImportProjectTeamService

Returns a new instance of ImportProjectTeamService.



7
8
9
10
11
# File 'app/services/members/import_project_team_service.rb', line 7

def initialize(*args)
  super

  @errors = {}
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/members/import_project_team_service.rb', line 13

def execute
  check_target_and_source_projects_exist!
  check_user_permissions!

  import_project_team
  process_import_result

  result
rescue ArgumentError, ImportProjectTeamForbiddenError => e
  ServiceResponse.error(message: e.message, reason: :unprocessable_entity)
end