diff options
Diffstat (limited to 'app/services/analytics/cycle_analytics/stages/list_service.rb')
-rw-r--r-- | app/services/analytics/cycle_analytics/stages/list_service.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/services/analytics/cycle_analytics/stages/list_service.rb b/app/services/analytics/cycle_analytics/stages/list_service.rb new file mode 100644 index 00000000000..a6b94ef8295 --- /dev/null +++ b/app/services/analytics/cycle_analytics/stages/list_service.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Analytics + module CycleAnalytics + module Stages + class ListService < Analytics::CycleAnalytics::Stages::BaseService + def execute + return forbidden unless allowed? + + success(build_default_stages) + end + + private + + def allowed? + can?(current_user, :read_cycle_analytics, parent) + end + + def success(stages) + ServiceResponse.success(payload: { stages: stages }) + end + end + end + end +end + +Analytics::CycleAnalytics::Stages::ListService.prepend_mod_with('Analytics::CycleAnalytics::Stages::ListService') |