Class: Namespaces::MarkForDeletionBaseService
- Inherits:
-
BaseService
- Object
- BaseService
- Namespaces::MarkForDeletionBaseService
- Defined in:
- app/services/namespaces/mark_for_deletion_base_service.rb
Direct Known Subclasses
Groups::MarkForDeletionService, Projects::MarkForDeletionService
Constant Summary collapse
- DELETION_SCHEDULED_PATH_INFIX =
'deletion_scheduled'- LEGACY_DELETION_SCHEDULED_PATH_INFIX =
'deleted'
Constants inherited from BaseService
BaseService::UnauthorizedError
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(resource, user, params = {}) ⇒ MarkForDeletionBaseService
constructor
A new instance of MarkForDeletionBaseService.
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
Constructor Details
#initialize(resource, user, params = {}) ⇒ MarkForDeletionBaseService
Returns a new instance of MarkForDeletionBaseService.
8 9 10 11 12 |
# File 'app/services/namespaces/mark_for_deletion_base_service.rb', line 8 def initialize(resource, user, params = {}) @resource = resource @current_user = user @params = params.dup end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/services/namespaces/mark_for_deletion_base_service.rb', line 14 def execute result = preconditions_checks return result if result.error? result = execute_deletion if result.success? log_event send_notification post_success else log_error(result.) end result end |