Class: ServiceDesk::CustomEmails::DestroyService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseProjectService
- BaseService
- ServiceDesk::CustomEmails::DestroyService
- Defined in:
- app/services/service_desk/custom_emails/destroy_service.rb
Instance Attribute Summary
Attributes inherited from BaseProjectService
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
Methods inherited from BaseProjectService
Methods inherited from BaseContainerService
#group_container?, #initialize, #namespace_container?, #project_container?, #project_group
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 BaseProjectService
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/services/service_desk/custom_emails/destroy_service.rb', line 6 def execute return error_feature_flag_disabled unless feature_flag_enabled? return unless legitimate_user? return error_does_not_exist unless verification? || credential? || setting? project.service_desk_custom_email_verification&.destroy project.service_desk_custom_email_credential&.destroy project.reset project.service_desk_setting&.update!(custom_email: nil, custom_email_enabled: false) log_info ServiceResponse.success end |