Class: Projects::GroupLinks::CreateService

Inherits:
BaseService
  • Object
show all
Includes:
GroupLinkable
Defined in:
app/services/projects/group_links/create_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

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?, #can_all?, #can_any?

Constructor Details

#initialize(project, shared_with_group, user, params) ⇒ CreateService

Returns a new instance of CreateService.



8
9
10
11
12
# File 'app/services/projects/group_links/create_service.rb', line 8

def initialize(project, shared_with_group, user, params)
  @shared_with_group = shared_with_group

  super(project, user, params)
end

Instance Method Details

#executeObject



14
15
16
17
18
19
20
# File 'app/services/projects/group_links/create_service.rb', line 14

def execute
  if adding_a_group_as_owner? && cannot_assign_owner_responsibilities_to_member_in_project?
    error('403 Forbidden', 403)
  else
    super
  end
end