Class: Groups::RestoreService

Inherits:
BaseService show all
Defined in:
app/services/groups/restore_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 inherited from BaseService

#initialize

Methods inherited from BaseService

#initialize

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

This class inherits a constructor from Groups::BaseService

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/services/groups/restore_service.rb', line 5

def execute
  return error(_('You are not authorized to perform this action')) unless can?(current_user, :remove_group, group)
  return error(_('Group has not been marked for deletion')) unless group.self_deletion_scheduled?
  return error(_('Group deletion is in progress')) if group.self_deletion_in_progress?

  result = remove_deletion_schedule

  group.reset

  log_event if result[:status] == :success

  result
end