Class: WorkItems::DeleteService
- Inherits:
-
Issuable::DestroyService
- Object
- BaseContainerService
- IssuableBaseService
- Issuable::DestroyService
- WorkItems::DeleteService
- Defined in:
- app/services/work_items/delete_service.rb
Instance Attribute Summary
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
Methods inherited from Issuable::DestroyService
Methods inherited from BaseContainerService
#group_container?, #initialize, #namespace_container?, #project_container?, #project_group, #root_ancestor
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 Issuable::DestroyService
Instance Method Details
#execute(work_item) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/work_items/delete_service.rb', line 5 def execute(work_item) unless current_user.can?(:delete_work_item, work_item) return ::ServiceResponse.error(message: 'User not authorized to delete work item') end if super publish_event(work_item) ::ServiceResponse.success else ::ServiceResponse.error(message: work_item.errors.) end end |