Class: Groups::GroupLinks::UpdateService

Inherits:
BaseService show all
Defined in:
app/services/groups/group_links/update_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #group, #params

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?

Constructor Details

#initialize(group_link, user = nil) ⇒ UpdateService

Returns a new instance of UpdateService.



6
7
8
9
10
# File 'app/services/groups/group_links/update_service.rb', line 6

def initialize(group_link, user = nil)
  super(group_link.shared_group, user)

  @group_link = group_link
end

Instance Method Details

#execute(group_link_params) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/services/groups/group_links/update_service.rb', line 12

def execute(group_link_params)
  group_link.update!(group_link_params)

  if requires_authorization_refresh?(group_link_params)
    group_link.shared_with_group.refresh_members_authorized_projects(direct_members_only: true)
  end

  group_link
end