Class: WorkItems::ImportCsvService
- Inherits:
-
Issuable::ImportCsv::BaseService
- Object
- ImportCsv::BaseService
- Issuable::ImportCsv::BaseService
- WorkItems::ImportCsvService
- Extended by:
- Gitlab::Utils::Override
- Includes:
- Issues::IssueTypeHelpers
- Defined in:
- app/services/work_items/import_csv_service.rb
Constant Summary collapse
- FeatureNotAvailableError =
StandardError.new( 'This feature is currently behind a feature flag and it is not available.' )
- NotAuthorizedError =
StandardError.new('You do not have permission to import work items in this project.')
Constants inherited from ImportCsv::BaseService
ImportCsv::BaseService::PreprocessError
Instance Method Summary collapse
- #email_results_to_user ⇒ Object
- #execute ⇒ Object
-
#initialize(*args) ⇒ ImportCsvService
constructor
A new instance of ImportCsvService.
Methods included from Gitlab::Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods included from Issues::IssueTypeHelpers
Methods inherited from Issuable::ImportCsv::BaseService
Methods included from Gitlab::Allowable
Constructor Details
#initialize(*args) ⇒ ImportCsvService
Returns a new instance of ImportCsvService.
14 15 16 17 18 19 20 21 22 |
# File 'app/services/work_items/import_csv_service.rb', line 14 def initialize(*args) super @type_errors = { blank: [], missing: {}, disallowed: {} } end |
Instance Method Details
#email_results_to_user ⇒ Object
30 31 32 |
# File 'app/services/work_items/import_csv_service.rb', line 30 def email_results_to_user Notify.import_work_items_csv_email(user.id, project.id, results).deliver_later end |
#execute ⇒ Object
24 25 26 27 28 |
# File 'app/services/work_items/import_csv_service.rb', line 24 def execute raise NotAuthorizedError unless Ability.allowed?(user, :import_work_items, project) super end |