Class: Projects::GroupLinks::UpdateService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/projects/group_links/update_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?

Constructor Details

#initialize(group_link, user = nil) ⇒ UpdateService

Returns a new instance of UpdateService.


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

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

  @group_link = group_link
end

Instance Method Details

#execute(group_link_params) ⇒ Object


12
13
14
15
16
# File 'app/services/projects/group_links/update_service.rb', line 12

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

  refresh_authorizations if requires_authorization_refresh?(group_link_params)
end