Class: Releases::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- Releases::DestroyService
- Defined in:
- app/services/releases/destroy_service.rb
Constant Summary
Constants inherited from BaseService
BaseService::ReleaseProtectedTagAccessError
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
Methods inherited from BaseService
#description, #execute_hooks, #existing_tag, #inexistent_milestone_ids, #inexistent_milestone_titles, #initialize, #milestones, #name, #param_for_milestone_ids_provided?, #param_for_milestone_titles_provided?, #param_for_milestones_exists?, #param_for_milestones_provided?, #project_group_id, #ref, #release, #released_at, #repository, #tag_message, #tag_name
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
This class inherits a constructor from Releases::BaseService
Instance Method Details
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/releases/destroy_service.rb', line 5 def execute return error(_('Release does not exist'), 404) unless release return error(_('Access Denied'), 403) unless allowed? if release.destroy update_catalog_resource! success(tag: existing_tag, release: release) else error(release.errors. || '400 Bad request', 400) end end |