blob: a6b94ef82951afb4f42b825e5e9663cef397092d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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')
|